Skip to content

Commit

Permalink
chore: Fixed nullable Tag Dto parentId
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Jun 7, 2024
1 parent b7a91a9 commit d296690
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/RoadizCoreBundle/src/Model/TagTreeDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(
private readonly ?string $name,
private readonly string $color,
private readonly bool $visible,
private readonly int $parentId,
private readonly ?int $parentId,
) {
}

Expand Down Expand Up @@ -46,7 +46,7 @@ public function isVisible(): bool
return $this->visible;
}

public function getParentId(): int
public function getParentId(): ?int
{
return $this->parentId;
}
Expand Down
5 changes: 4 additions & 1 deletion lib/Rozier/src/Widgets/NodeTreeWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,11 @@ public function getNodes(): iterable
/**
* @return array<TagTreeDto>
*/
public function getTags(Node|NodeTreeDto $node): array
public function getTags(Node|NodeTreeDto|null $node): array
{
if (null === $node) {
return [];
}
return $this->managerRegistry->getRepository(Tag::class)->findByAsTagTreeDto([
"nodes" => $node->getId(),
], [
Expand Down

0 comments on commit d296690

Please sign in to comment.