1010use Symfony \Component \HttpKernel \KernelInterface ;
1111
1212/**
13- * A menu provider that allows for an AcmeBundle:Builder:mainMenu shortcut syntax
13+ * A menu provider that allows for an AcmeBundle:Builder:mainMenu shortcut syntax.
1414 *
1515 * @author Ryan Weaver <[email protected] > 1616 */
@@ -32,7 +32,7 @@ public function __construct(KernelInterface $kernel, ContainerInterface $contain
3232 }
3333
3434 /**
35- * Looks for a menu with the bundle:class:method format
35+ * Looks for a menu with the bundle:class:method format.
3636 *
3737 * For example, AcmeBundle:Builder:mainMenu would create and instantiate
3838 * an Acme\DemoBundle\Menu\Builder class and call the mainMenu() method
@@ -42,6 +42,7 @@ public function __construct(KernelInterface $kernel, ContainerInterface $contain
4242 * @param array $options
4343 *
4444 * @return \Knp\Menu\ItemInterface
45+ *
4546 * @throws \InvalidArgumentException
4647 */
4748 public function get ($ name , array $ options = [])
@@ -71,15 +72,15 @@ public function get($name, array $options = [])
7172 * @param string $name The alias name of the menu
7273 * @param array $options
7374 *
74- * @return Boolean
75+ * @return bool
7576 */
7677 public function has ($ name , array $ options = [])
7778 {
7879 return 2 == substr_count ($ name , ': ' );
7980 }
8081
8182 /**
82- * Creates and returns the builder that lives in the given bundle
83+ * Creates and returns the builder that lives in the given bundle.
8384 *
8485 * The convention is to look in the Menu namespace of the bundle for
8586 * this class, to instantiate it with no arguments, and to inject the
@@ -104,7 +105,7 @@ protected function getBuilder($bundleName, $className)
104105 $ allBundles = $ this ->kernel ->getBundle ($ bundleName , false );
105106
106107 // In Symfony 4, bundle inheritance is gone, so there is no way to get an array anymore.
107- if (!is_array ($ allBundles )) {
108+ if (!\ is_array ($ allBundles )) {
108109 $ allBundles = [$ allBundles ];
109110 }
110111
@@ -120,7 +121,7 @@ protected function getBuilder($bundleName, $className)
120121 }
121122
122123 if (null === $ class ) {
123- if (1 === count ($ logs )) {
124+ if (1 === \ count ($ logs )) {
124125 throw new \InvalidArgumentException ($ logs [0 ]);
125126 }
126127
0 commit comments