1 | <?php |
||
9 | class SimpleItemAction implements ItemActionInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var callable |
||
13 | */ |
||
14 | private $routerGenerator; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $icon; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $label; |
||
25 | |||
26 | /** |
||
27 | * @var string|null |
||
28 | */ |
||
29 | private $template; |
||
30 | |||
31 | /** |
||
32 | * @param callable $routerGenerator the generator used to generate the url of an item, when generating the item will |
||
33 | * be provided |
||
34 | * @param string $icon The icon |
||
35 | * @param string $label The label |
||
36 | * @param string $template The template |
||
|
|||
37 | */ |
||
38 | 4 | public function __construct($routerGenerator, $icon, $label, $template = null) |
|
45 | |||
46 | /** |
||
47 | * @param mixed $item |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | 3 | public function getUrlFor($item) |
|
60 | |||
61 | /** |
||
62 | * @param mixed $item |
||
63 | * |
||
64 | * @return string |
||
65 | */ |
||
66 | 1 | public function getIconFor($item) |
|
70 | |||
71 | /** |
||
72 | * @param mixed $item |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | 1 | public function getLabelFor($item) |
|
80 | |||
81 | /** |
||
82 | * @return string |
||
83 | */ |
||
84 | 1 | public function getTemplate() |
|
88 | } |
||
89 |
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.