From fc467c71d2754ff8f6d45a297da4605a0d648456 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 5 May 2022 22:23:01 +0200 Subject: [PATCH] Add some return type hints [3.x] (#24) Some of the type hints resolve deprecation notices emitted by Symfony, to prepare for adding type hints in future Symfony releases. --- Build/BuildContext.php | 8 +-- Build/BuildDirector.php | 3 + Build/BuildDispatcher.php | 12 ++-- Build/TreeFactory.php | 20 ++---- Command/DumpTreeCommand.php | 2 +- Controller/NavigationController.php | 9 +-- .../Compiler/BuildDirectorPass.php | 2 +- .../WebfactoryNavigationExtension.php | 2 +- Event/ActiveNodeEventListener.php | 2 +- Event/TreeInitializedEvent.php | 5 +- Tree/Finder.php | 10 +-- Tree/Node.php | 71 +++++++++++-------- Tree/Tree.php | 24 +++---- Twig/NavigationExtension.php | 25 +++---- Twig/NavigationThemeExtension.php | 31 ++++---- Twig/NavigationThemeNode.php | 2 +- Twig/NavigationThemeTokenParser.php | 4 +- WebfactoryNavigationBundle.php | 2 +- 18 files changed, 107 insertions(+), 127 deletions(-) diff --git a/Build/BuildContext.php b/Build/BuildContext.php index 46b65ab..d1db2a3 100644 --- a/Build/BuildContext.php +++ b/Build/BuildContext.php @@ -25,20 +25,16 @@ public function __construct(array $params) /** * @param array $params - * - * @return BuildContext */ - public function change(array $params) + public function change(array $params): self { return new self(array_merge($this->params, $params)); } /** - * @param string $name - * * @return mixed|null */ - public function get($name) + public function get(string $name) { return isset($this->params[$name]) ? $this->params[$name] : null; } diff --git a/Build/BuildDirector.php b/Build/BuildDirector.php index c38f7e1..c188c7c 100644 --- a/Build/BuildDirector.php +++ b/Build/BuildDirector.php @@ -16,5 +16,8 @@ */ interface BuildDirector { + /** + * @return void + */ public function build(BuildContext $c, Tree $t, BuildDispatcher $d); } diff --git a/Build/BuildDispatcher.php b/Build/BuildDispatcher.php index 26a8148..cc5c89c 100644 --- a/Build/BuildDispatcher.php +++ b/Build/BuildDispatcher.php @@ -17,12 +17,12 @@ class BuildDispatcher protected $resources = []; protected $queue; - public function addDirector(BuildDirector $director, $priority = 100) + public function addDirector(BuildDirector $director, $priority = 100): void { $this->directors[$priority][] = $director; } - public function start(Tree $tree) + public function start(Tree $tree): void { $directorsOrderedByPriority = $this->getDirectorsOrderedByPriority(); $this->queue = [new BuildContext([])]; @@ -33,17 +33,17 @@ public function start(Tree $tree) } } - public function search(BuildContext $context) + public function search(BuildContext $context): void { $this->queue[] = $context; } - public function addResource(ResourceInterface $resource) + public function addResource(ResourceInterface $resource): void { $this->resources[] = $resource; } - public function getResources() + public function getResources(): array { return array_unique($this->resources); } @@ -51,7 +51,7 @@ public function getResources() /** * @return BuildDirector[] */ - private function getDirectorsOrderedByPriority() + private function getDirectorsOrderedByPriority(): array { krsort($this->directors, SORT_NUMERIC); $buildDirectorsOrderedByPriority = []; diff --git a/Build/TreeFactory.php b/Build/TreeFactory.php index 24119b3..05b518c 100644 --- a/Build/TreeFactory.php +++ b/Build/TreeFactory.php @@ -41,7 +41,7 @@ class TreeFactory implements ServiceSubscriberInterface /** @var ContainerInterface */ protected $container; - public static function getSubscribedServices() + public static function getSubscribedServices(): array { return [ BuildDispatcher::class @@ -64,19 +64,14 @@ public function __construct( $this->stopwatch = $stopwatch; } - public function debug($msg) + public function debug(string $msg): void { if ($this->logger) { $this->logger->debug("$msg (PID ".getmypid().', microtime '.microtime().')'); } } - /** - * @param $sectionName - * - * @return StopwatchEvent|null - */ - protected function startTiming($sectionName) + protected function startTiming(string $sectionName): ?StopwatchEvent { if ($this->stopwatch) { return $this->stopwatch->start('webfactory/navigation-bundle: '.$sectionName); @@ -85,17 +80,14 @@ protected function startTiming($sectionName) return null; } - protected function stopTiming(StopwatchEvent $watch = null) + protected function stopTiming(StopwatchEvent $watch = null): void { if ($watch) { $watch->stop(); } } - /** - * @return Tree - */ - public function getTree() + public function getTree(): Tree { if (!$this->_tree) { $self = $this; @@ -124,7 +116,7 @@ public function getTree() return $this->_tree; } - public function buildTreeCache(ConfigCacheInterface $cache) + public function buildTreeCache(ConfigCacheInterface $cache): void { $this->_tree = new Tree(); // Dynamic (runtime) lookup: diff --git a/Command/DumpTreeCommand.php b/Command/DumpTreeCommand.php index bd28d9e..8d240f7 100644 --- a/Command/DumpTreeCommand.php +++ b/Command/DumpTreeCommand.php @@ -32,7 +32,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int return 0; } - private function dumpNode(Node $n, OutputInterface $output, $depth = 0) + private function dumpNode(Node $n, OutputInterface $output, $depth = 0): void { $first = true; diff --git a/Controller/NavigationController.php b/Controller/NavigationController.php index 11a60a0..9b9e2fc 100644 --- a/Controller/NavigationController.php +++ b/Controller/NavigationController.php @@ -15,7 +15,7 @@ class NavigationController extends AbstractController { - public static function getSubscribedServices() + public static function getSubscribedServices(): array { return array_merge(parent::getSubscribedServices(), [ Tree::class, @@ -39,7 +39,8 @@ public function treeAction( $maxLevels = 1, $expandedLevels = 1, $template = '@WebfactoryNavigation/Navigation/navigation.html.twig' - ) { + ): Response + { if (\is_array($root)) { $node = $this->getTree()->find($root); if (!$node) { @@ -81,7 +82,7 @@ public function treeAction( * * @return Response */ - public function ancestryAction($startLevel, $maxLevels = 1, $expandedLevels = 1, $template = '@WebfactoryNavigation/Navigation/navigation.html.twig') + public function ancestryAction($startLevel, $maxLevels = 1, $expandedLevels = 1, $template = '@WebfactoryNavigation/Navigation/navigation.html.twig'): Response { if ($node = $this->getTree()->getActivePath()) { $path = $node->getPath(); @@ -101,7 +102,7 @@ public function ancestryAction($startLevel, $maxLevels = 1, $expandedLevels = 1, * * @return Response */ - public function breadcrumbsAction($template = '@WebfactoryNavigation/Navigation/breadcrumbs.html.twig') + public function breadcrumbsAction($template = '@WebfactoryNavigation/Navigation/breadcrumbs.html.twig'): Response { if ($node = $this->getTree()->getActivePath()) { return $this->render($template, [ diff --git a/DependencyInjection/Compiler/BuildDirectorPass.php b/DependencyInjection/Compiler/BuildDirectorPass.php index c1a5a94..d24b587 100644 --- a/DependencyInjection/Compiler/BuildDirectorPass.php +++ b/DependencyInjection/Compiler/BuildDirectorPass.php @@ -15,7 +15,7 @@ class BuildDirectorPass implements CompilerPassInterface { - public function process(ContainerBuilder $container) + public function process(ContainerBuilder $container): void { if (false === $container->hasDefinition(BuildDispatcher::class)) { return; diff --git a/DependencyInjection/WebfactoryNavigationExtension.php b/DependencyInjection/WebfactoryNavigationExtension.php index c939140..f0582ac 100644 --- a/DependencyInjection/WebfactoryNavigationExtension.php +++ b/DependencyInjection/WebfactoryNavigationExtension.php @@ -15,7 +15,7 @@ class WebfactoryNavigationExtension extends Extension { - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.xml'); diff --git a/Event/ActiveNodeEventListener.php b/Event/ActiveNodeEventListener.php index 93350b0..66f5123 100644 --- a/Event/ActiveNodeEventListener.php +++ b/Event/ActiveNodeEventListener.php @@ -20,7 +20,7 @@ public function __construct(RequestStack $requestStack) $this->requestStack = $requestStack; } - public function initializeTree(TreeInitializedEvent $event) + public function initializeTree(TreeInitializedEvent $event): void { if ($masterRequest = $this->requestStack->getMasterRequest()) { if ($node = $event->getTree()->find($masterRequest->attributes->all())) { diff --git a/Event/TreeInitializedEvent.php b/Event/TreeInitializedEvent.php index 4bab04a..8bb35a3 100644 --- a/Event/TreeInitializedEvent.php +++ b/Event/TreeInitializedEvent.php @@ -21,10 +21,7 @@ public function __construct(Tree $tree) $this->tree = $tree; } - /** - * @return Tree - */ - public function getTree() + public function getTree(): Tree { return $this->tree; } diff --git a/Tree/Finder.php b/Tree/Finder.php index 21a4c95..8a2d5ca 100644 --- a/Tree/Finder.php +++ b/Tree/Finder.php @@ -22,11 +22,7 @@ class Finder /** @var string[] */ protected $idToHash = []; - /** - * @param Node $object - * @param array $requirements - */ - public function add($object, array $requirements) + public function add(Node $object, array $requirements): void { $hash = spl_object_hash($object); $this->objects[$hash] = $object; @@ -48,10 +44,8 @@ public function add($object, array $requirements) /** * @param string|array|object $provided - * - * @return Node|null */ - public function lookup($provided) + public function lookup($provided): ?Node { $remainingCount = []; $maxMatch = 0; diff --git a/Tree/Node.php b/Tree/Node.php index 7d6e40a..26eaa71 100644 --- a/Tree/Node.php +++ b/Tree/Node.php @@ -34,7 +34,7 @@ class Node implements \ArrayAccess * * @return Node returns the given or newly created node, for use in fluent notations */ - public function addChild(self $n = null) + public function addChild(self $n = null): self { if (null === $n) { $n = new self(); @@ -47,12 +47,12 @@ public function addChild(self $n = null) return $n; } - public function setTree(Tree $t) + public function setTree(Tree $t): void { $this->tree = $t; } - public function getTree() + public function getTree(): Tree { return $this->tree; } @@ -64,7 +64,7 @@ public function getTree() * * @return $this the node itself, for use in fluent notations */ - public function index(array $requirements) + public function index(array $requirements): self { $this->tree->addFindIndex($this, $requirements); @@ -72,7 +72,7 @@ public function index(array $requirements) } /** @deprecated */ - public function activateOn(array $requirements) + public function activateOn(array $requirements): self { return $this->index($requirements); } @@ -85,7 +85,7 @@ public function activateOn(array $requirements) * * @return $this the node itself, for use in fluent notations */ - public function set($name, $value) + public function set($name, $value): self { $this->data[$name] = $value; @@ -99,7 +99,7 @@ public function set($name, $value) * * @return mixed|null the value, or null if the $name is unknown */ - public function get($name) + public function get(string $name) { return isset($this->data[$name]) ? $this->data[$name] : null; } @@ -109,15 +109,12 @@ public function get($name) * * @return array */ - public function getData() + public function getData(): array { return $this->data; } - /** - * @return Node|null returns the parent node - */ - public function getParent() + public function getParent(): ?Node { return $this->parent; } @@ -125,7 +122,7 @@ public function getParent() /** * @return Node[] the array of all Nodes from the root towards this node */ - public function getPath() + public function getPath(): array { if (null === $this->parent) { return [$this]; @@ -140,7 +137,7 @@ public function getPath() /** * @return Node[] returns all child nodes */ - public function getChildren() + public function getChildren(): array { return $this->children; } @@ -148,7 +145,7 @@ public function getChildren() /** * @return bool whether the node has child nodes or not */ - public function hasChildren() + public function hasChildren(): bool { return (bool) $this->children; } @@ -156,7 +153,7 @@ public function hasChildren() /** * @return bool whether the node has visible child nodes or not */ - public function hasVisibleChildren() + public function hasVisibleChildren(): bool { foreach ($this->children as $childNode) { if (true === $childNode->get('visible')) { @@ -172,7 +169,7 @@ public function hasVisibleChildren() * * @return bool true if the given node is an ancestor of the current node */ - public function hasAncestor(self $ancestor) + public function hasAncestor(self $ancestor): bool { return $this->parent && (($this->parent === $ancestor) || $this->parent->hasAncestor($ancestor)); } @@ -182,7 +179,7 @@ public function hasAncestor(self $ancestor) * * @return bool true if $descendant is a descendant of the current node */ - public function hasDescendant(self $descendant) + public function hasDescendant(self $descendant): bool { return $descendant->hasAncestor($this); } @@ -190,7 +187,7 @@ public function hasDescendant(self $descendant) /** * @return int returns the level of this node, with "0" being the root level */ - public function getLevel() + public function getLevel(): int { if ($this->parent) { return $this->parent->getLevel() + 1; @@ -204,7 +201,7 @@ public function getLevel() * * @return $this the node itself, for use in fluent notations */ - public function setActive() + public function setActive(): self { $this->tree->setActiveNode($this); @@ -225,7 +222,7 @@ public function setActive() * * @return $this the node itself, for use in fluent notations */ - public function setActivePath() + public function setActivePath(): self { $this->tree->setActivePath($this); @@ -235,7 +232,7 @@ public function setActivePath() /** * @return bool whether this is the currently active node in the tree */ - public function isActiveNode() + public function isActiveNode(): bool { return $this->tree->getActiveNode() === $this; } @@ -243,7 +240,7 @@ public function isActiveNode() /** * @return bool whether this node lies on the path from the Tree root towards the active node */ - public function isActivePath() + public function isActivePath(): bool { if (!($ap = $this->tree->getActivePath())) { return false; @@ -252,29 +249,43 @@ public function isActivePath() return $this === $ap || $this->hasDescendant($ap); } - public function offsetExists($offset) + /** + * @param mixed $offset + */ + public function offsetExists($offset): bool { return isset($this->data[$offset]); } + /** + * @param mixed $offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->get($offset); } - public function offsetSet($offset, $value) + /** + * @param mixed $offset + * @param mixed $value + */ + public function offsetSet($offset, $value): void { - return $this->set($offset, $value); + $this->set($offset, $value); } - public function offsetUnset($offset) + /** + * @param mixed $offset + */ + public function offsetUnset($offset): void { unset($this->data[$offset]); - - return $this; } - protected function setParent(self $p) + protected function setParent(self $p): void { $this->parent = $p; } diff --git a/Tree/Tree.php b/Tree/Tree.php index 4a19a22..22d65d0 100644 --- a/Tree/Tree.php +++ b/Tree/Tree.php @@ -28,7 +28,7 @@ class Tree * because it results from user input and we cannot enumerate all the possible * nodes when building the tree. * - * @var Node|null + * @var ?Node */ protected $activePath = null; @@ -37,7 +37,7 @@ public function __construct() $this->finder = new Finder(); } - public function addRoot(Node $r = null) + public function addRoot(Node $r = null): Node { if (null === $r) { $r = new Node(); @@ -48,27 +48,25 @@ public function addRoot(Node $r = null) return $r; } - public function getRootNodes() + public function getRootNodes(): array { return $this->roots; } - public function addFindIndex(Node $n, array $requirements) + public function addFindIndex(Node $n, array $requirements): void { $this->finder->add($n, $requirements); } - public function find(array $provisions) + public function find(array $provisions): ?Node { return $this->finder->lookup($provisions); } /** * Sets the active Node. - * - * @param Node $n */ - public function setActiveNode(Node $n) + public function setActiveNode(Node $n): void { $this->activeNode = $this->activePath = $n; } @@ -76,10 +74,8 @@ public function setActiveNode(Node $n) /** * Sets a node as the "closest to active" node in the tree, but making this particular * node itself *not* active. - * - * @param Node $n */ - public function setActivePath(Node $n) + public function setActivePath(Node $n): void { $this->activeNode = null; $this->activePath = $n; @@ -88,7 +84,7 @@ public function setActivePath(Node $n) /** * @return Node|null returns the currently active node, if available */ - public function getActiveNode() + public function getActiveNode(): ?Node { return $this->activeNode; } @@ -97,10 +93,8 @@ public function getActiveNode() * Returns the node that is currently active or comes closest to the actually active state. Use * \Webfactory\Bundle\NavigationBundle\Tree\Node::isActiveNode to query whether the node is indeed active * or not. - * - * @return Node|null */ - public function getActivePath() + public function getActivePath(): ?Node { return $this->activePath; } diff --git a/Twig/NavigationExtension.php b/Twig/NavigationExtension.php index f2a679e..43a16ed 100644 --- a/Twig/NavigationExtension.php +++ b/Twig/NavigationExtension.php @@ -18,7 +18,7 @@ public function __construct(TreeFactory $treeFactory) $this->treeFactory = $treeFactory; } - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('navigation_active_at_level', [$this, 'getNavigationActiveAtLevel']), @@ -30,20 +30,16 @@ public function getFunctions() /** * Returns the currently active tree node. - * - * @return Node */ - public function getActiveNode() + public function getActiveNode(): Node { return $this->getTree()->getActiveNode(); } /** * Returns the currently active "path" node. - * - * @return Node */ - public function getActivePath() + public function getActivePath(): Node { return $this->getTree()->getActivePath(); } @@ -51,11 +47,11 @@ public function getActivePath() /** * Returns the navigation node which lies on the currently active path at the given level. * - * @param $level The level of the node to be returned + * @param int $level The level of the node to be returned * - * @return \Webfactory\Bundle\NavigationBundle\Tree\Node|null A node or null if no node at the given level exists + * @return ?Node A node or null if no node at the given level exists */ - public function getNavigationActiveAtLevel($level) + public function getNavigationActiveAtLevel(int $level): ?Node { $activeNode = $this->getTree()->getActiveNode(); @@ -76,18 +72,13 @@ public function getNavigationActiveAtLevel($level) * Finds a node indexed in the tree. See \Webfactory\Bundle\NavigationBundle\Tree\Tree::find. * * @param array $provisions parameters used to look up the node - * - * @return \Webfactory\Bundle\NavigationBundle\Tree\Node|null */ - public function findNode(array $provisions) + public function findNode(array $provisions): ?Node { return $this->getTree()->find($provisions); } - /** - * @return Tree - */ - private function getTree() + private function getTree(): Tree { return $this->treeFactory->getTree(); } diff --git a/Twig/NavigationThemeExtension.php b/Twig/NavigationThemeExtension.php index f252b16..ffa0f28 100644 --- a/Twig/NavigationThemeExtension.php +++ b/Twig/NavigationThemeExtension.php @@ -31,20 +31,20 @@ public function __construct(array $resources = []) $this->blocks = new \SplObjectStorage(); } - public function getTokenParsers() + public function getTokenParsers(): array { return [ new NavigationThemeTokenParser(), ]; } - public function setTheme(Node $themeRoot, array $resources) + public function setTheme(Node $themeRoot, array $resources): void { $this->themes->attach($themeRoot, $resources); $this->blocks = new \SplObjectStorage(); } - public function getFunctions() + public function getFunctions(): array { return [ new TwigFunction('power_set', [$this, 'getPowerSet']), @@ -60,7 +60,7 @@ public function getFunctions() ]; } - public function getPowerSet(array $baseSet) + public function getPowerSet(array $baseSet): array { $count = \count($baseSet); $members = pow(2, $count); @@ -79,7 +79,7 @@ public function getPowerSet(array $baseSet) return $powerSet; } - public function renderNavigation(Environment $env, Node $node, $maxLevels, $expandedLevels) + public function renderNavigation(Environment $env, Node $node, $maxLevels, $expandedLevels): string { return $this->renderNavigationList($env, $node, $node->getChildren(), 0, $maxLevels, $expandedLevels, $node); } @@ -92,7 +92,8 @@ public function renderNavigationList( $maxLevels, $expandedLevels, Node $parentNode = null - ) { + ): string + { if ($nodes && $level < $maxLevels && ($level < $expandedLevels || $parentNode->isActivePath())) { return $this->renderBlock($env, $themeRoot, 'navigation_list', get_defined_vars()); } @@ -100,42 +101,42 @@ public function renderNavigationList( return ''; } - public function renderNavigationListClass(Environment $env, Node $themeRoot, array $nodes, $level, Node $parentNode = null) + public function renderNavigationListClass(Environment $env, Node $themeRoot, array $nodes, $level, Node $parentNode = null): string { return $this->renderBlock($env, $themeRoot, 'navigation_list_class', get_defined_vars()); } - public function renderNavigationItem(Environment $env, Node $themeRoot, Node $node, $level, $maxLevels, $expandedLevels, $loop) + public function renderNavigationItem(Environment $env, Node $themeRoot, Node $node, $level, $maxLevels, $expandedLevels, $loop): string { return $this->renderBlock($env, $themeRoot, 'navigation_item', get_defined_vars()); } - public function renderNavigationItemClass(Environment $env, Node $themeRoot, Node $node, $level, $loop) + public function renderNavigationItemClass(Environment $env, Node $themeRoot, Node $node, $level, $loop): string { return $this->renderBlock($env, $themeRoot, 'navigation_item_class', get_defined_vars()); } - public function renderNavigationText(Environment $env, Node $themeRoot, Node $node, $level) + public function renderNavigationText(Environment $env, Node $themeRoot, Node $node, $level): string { return $this->renderBlock($env, $themeRoot, 'navigation_text', get_defined_vars()); } - public function renderNavigationTextClass(Environment $env, Node $themeRoot, Node $node, $level) + public function renderNavigationTextClass(Environment $env, Node $themeRoot, Node $node, $level): string { return $this->renderBlock($env, $themeRoot, 'navigation_text_class', get_defined_vars()); } - public function renderNavigationUrl(Environment $env, Node $themeRoot, Node $node, $level) + public function renderNavigationUrl(Environment $env, Node $themeRoot, Node $node, $level): string { return $this->renderBlock($env, $themeRoot, 'navigation_url', get_defined_vars()); } - public function renderNavigationCaption(Environment $env, Node $themeRoot, Node $node, $level) + public function renderNavigationCaption(Environment $env, Node $themeRoot, Node $node, $level): string { return $this->renderBlock($env, $themeRoot, 'navigation_caption', get_defined_vars()); } - public function renderBlock(Environment $env, $themeRoot, $name, array $variables) + public function renderBlock(Environment $env, $themeRoot, $name, array $variables): string { if (!$this->template) { $this->template = $env->loadTemplate(reset($this->resources)); @@ -146,7 +147,7 @@ public function renderBlock(Environment $env, $themeRoot, $name, array $variable return $this->template->renderBlock($name, $variables, $blocks); } - protected function getBlocks(Environment $env, Node $themeRoot) + protected function getBlocks(Environment $env, Node $themeRoot): array { if (!$this->blocks->contains($themeRoot)) { $resources = $this->resources; diff --git a/Twig/NavigationThemeNode.php b/Twig/NavigationThemeNode.php index 3b36855..69fa466 100644 --- a/Twig/NavigationThemeNode.php +++ b/Twig/NavigationThemeNode.php @@ -22,7 +22,7 @@ public function __construct( parent::__construct(['navigation' => $navigation, 'resources' => $resources], [], $lineNumber, $tag); } - public function compile(Compiler $compiler) + public function compile(Compiler $compiler): void { $compiler ->addDebugInfo($this) diff --git a/Twig/NavigationThemeTokenParser.php b/Twig/NavigationThemeTokenParser.php index ed37d03..934028b 100644 --- a/Twig/NavigationThemeTokenParser.php +++ b/Twig/NavigationThemeTokenParser.php @@ -14,7 +14,7 @@ class NavigationThemeTokenParser extends AbstractTokenParser { - public function parse(Token $token) + public function parse(Token $token): Node { $lineNumber = $token->getLine(); $stream = $this->parser->getStream(); @@ -30,7 +30,7 @@ public function parse(Token $token) return new NavigationThemeNode($navigation, new Node($resources), $lineNumber, $this->getTag()); } - public function getTag() + public function getTag(): string { return 'navigation_theme'; } diff --git a/WebfactoryNavigationBundle.php b/WebfactoryNavigationBundle.php index 13c7267..989098d 100644 --- a/WebfactoryNavigationBundle.php +++ b/WebfactoryNavigationBundle.php @@ -14,7 +14,7 @@ class WebfactoryNavigationBundle extends Bundle { - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { $container->addCompilerPass(new BuildDirectorPass()); }