Skip to content

Commit

Permalink
Comply with coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
JDruery committed Aug 26, 2024
1 parent 29fd9bf commit eac3291
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Tree/Strategy/ORM/Closure.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,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);

Expand Down
15 changes: 6 additions & 9 deletions tests/Gedmo/Tree/Fixture/Issue2652/Category2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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<int, Category2Closure>
Expand Down
5 changes: 1 addition & 4 deletions tests/Gedmo/Tree/Issue/Issue2652Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit eac3291

Please sign in to comment.