1 | <?php |
||
8 | class SimpleMenuAdaptor implements MenuAdaptorInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var AuthorizationCheckerInterface |
||
12 | */ |
||
13 | private $authorizationChecker; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | private $menuItems; |
||
19 | |||
20 | /** |
||
21 | * @param AuthorizationCheckerInterface $authorizationChecker |
||
22 | * @param array $menuItems |
||
23 | */ |
||
24 | 3 | public function __construct(AuthorizationCheckerInterface $authorizationChecker, array $menuItems) |
|
29 | |||
30 | /** |
||
31 | * In this method you can add children for a specific parent, but also remove and change the already created |
||
32 | * children |
||
33 | * |
||
34 | * @param MenuBuilder $menu The MenuBuilder |
||
35 | * @param MenuItem[] &$children The current children |
||
36 | * @param MenuItem|null $parent The parent Menu item |
||
37 | * @param Request $request The Request |
||
|
|||
38 | */ |
||
39 | 2 | public function adaptChildren(MenuBuilder $menu, array &$children, MenuItem $parent = null, Request $request = null) |
|
65 | |||
66 | /** |
||
67 | * @param MenuItem $parent |
||
68 | * @param array $item |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | 2 | private function parentMatches(MenuItem $parent = null, $item) |
|
80 | } |
||
81 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.