From e6c6de600d7cf06976c6e3f10c91dc72c7184f21 Mon Sep 17 00:00:00 2001 From: JDruery Date: Tue, 7 Nov 2023 16:14:47 -0500 Subject: [PATCH] Comply with coding standards --- src/Tree/Strategy/ORM/Closure.php | 2 +- tests/Gedmo/Tree/Fixture/Issue2652/Category2.php | 15 ++++++--------- tests/Gedmo/Tree/Issue/Issue2652Test.php | 5 +---- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/Tree/Strategy/ORM/Closure.php b/src/Tree/Strategy/ORM/Closure.php index 0128c9d1c4..87941de3db 100644 --- a/src/Tree/Strategy/ORM/Closure.php +++ b/src/Tree/Strategy/ORM/Closure.php @@ -489,7 +489,7 @@ protected function getJoinColumnFieldName($association) protected function setLevelFieldOnPendingNodes(ObjectManager $em) { while (!empty($this->pendingNodesLevelProcess)) { - // Nodes need to be processed one class at a time. Each iteration through the while loop will process one type, starting with the first item on the list. + // Nodes need to be processed one class at a time. Each iteration through the while loop will process one type, starting with the first item on the list. $first = array_slice($this->pendingNodesLevelProcess, 0, 1); $first = array_shift($first); diff --git a/tests/Gedmo/Tree/Fixture/Issue2652/Category2.php b/tests/Gedmo/Tree/Fixture/Issue2652/Category2.php index ebe42d58cf..50e6e67642 100644 --- a/tests/Gedmo/Tree/Fixture/Issue2652/Category2.php +++ b/tests/Gedmo/Tree/Fixture/Issue2652/Category2.php @@ -21,6 +21,7 @@ /** * @Gedmo\Tree(type="closure") * @Gedmo\TreeClosure(class="Category2Closure") + * * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\ClosureTreeRepository") */ #[ORM\Entity(repositoryClass: ClosureTreeRepository::class)] @@ -41,34 +42,30 @@ class Category2 private $id; /** - * @var string|null - * * @ORM\Column(name="title", type="string", length=64) */ #[ORM\Column(name: 'title', type: Types::STRING, length: 64)] - private $title; + private ?string $title = null; /** - * @var int|null - * * @ORM\Column(name="level", type="integer", nullable=true) + * * @Gedmo\TreeLevel */ #[ORM\Column(name: 'level', type: Types::INTEGER, nullable: true)] #[Gedmo\TreeLevel] - private $level; + private ?int $level = null; /** - * @var self|null - * * @Gedmo\TreeParent + * * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE") * @ORM\ManyToOne(targetEntity="Category2", inversedBy="children") */ #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'category2_id', referencedColumnName: 'id', onDelete: 'CASCADE')] #[Gedmo\TreeParent] - private $parent; + private ?\Gedmo\Tests\Tree\Fixture\Issue2652\Category2 $parent = null; /** * @var Collection diff --git a/tests/Gedmo/Tree/Issue/Issue2652Test.php b/tests/Gedmo/Tree/Issue/Issue2652Test.php index 6e8b7b1a60..b7255025f1 100644 --- a/tests/Gedmo/Tree/Issue/Issue2652Test.php +++ b/tests/Gedmo/Tree/Issue/Issue2652Test.php @@ -32,10 +32,7 @@ final class Issue2652Test extends BaseTestCaseORM private const CATEGORY2 = Category2::class; private const CLOSURE2 = Category2Closure::class; - /** - * @var TreeListener - */ - private $listener; + private TreeListener $listener; protected function setUp(): void {