Skip to content

Commit

Permalink
Merge branch '7.1' into 7.x
Browse files Browse the repository at this point in the history
* 7.1:
  [AllBundles] Fix incorrect return types (#3385)
  • Loading branch information
acrobat committed Apr 3, 2024
2 parents 6bfd2f0 + a5f8ec8 commit 264d4b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Kunstmaan/MenuBundle/Twig/MenuTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getFunctions(): array
* @param string $lang
* @param array $options
*/
public function getMenu(Environment $environment, $name, $lang, $options = []): string
public function getMenu(Environment $environment, $name, $lang, $options = []): string|array
{
$options = array_merge($this->getDefaultOptions(), $options);

Expand Down
8 changes: 3 additions & 5 deletions src/Kunstmaan/NodeBundle/Twig/NodeTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,9 @@ public function getFunctions(): array
* @param int $nodeId
* @param string $lang
*/
public function getNodeTranslationByNodeId($nodeId, $lang): NodeTranslation
public function getNodeTranslationByNodeId($nodeId, $lang): ?NodeTranslation
{
$repo = $this->em->getRepository(NodeTranslation::class);

return $repo->getNodeTranslationByNodeId($nodeId, $lang);
return $this->em->getRepository(NodeTranslation::class)->getNodeTranslationByNodeId($nodeId, $lang);
}

public function getPageByNodeTranslation(NodeTranslation $nodeTranslation): ?object
Expand All @@ -129,7 +127,7 @@ public function getNodeFor(PageInterface $page): Node
return $this->em->getRepository(Node::class)->getNodeFor($page);
}

public function getNodeTranslationFor(PageInterface $page): NodeTranslation
public function getNodeTranslationFor(PageInterface $page): ?NodeTranslation
{
return $this->em->getRepository(NodeTranslation::class)->getNodeTranslationFor($page);
}
Expand Down

0 comments on commit 264d4b3

Please sign in to comment.