These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Kunstmaan\AdminBundle\Helper\AdminPanel; |
||
4 | |||
5 | class AdminPanelAction implements AdminPanelActionInterface |
||
6 | { |
||
7 | /** |
||
8 | * @var array |
||
9 | */ |
||
10 | private $url; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $icon; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $label; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $template = 'KunstmaanAdminBundle:AdminPanel:_admin_panel_action.html.twig'; |
||
26 | |||
27 | /** |
||
28 | * @param array $url The url path and parameters |
||
29 | * @param string $label The label |
||
30 | * @param string $icon The icon |
||
0 ignored issues
–
show
|
|||
31 | * @param string $template The template |
||
0 ignored issues
–
show
Should the type for parameter
$template not be string|null ?
This check looks for 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.
Loading history...
|
|||
32 | */ |
||
33 | 3 | public function __construct( |
|
34 | array $url, |
||
35 | $label, |
||
36 | $icon = null, |
||
37 | $template = null |
||
38 | ) { |
||
39 | 3 | $this->url = $url; |
|
40 | 3 | $this->icon = $icon; |
|
41 | 3 | $this->label = $label; |
|
42 | 3 | if (!empty($template)) { |
|
43 | 3 | $this->template = $template; |
|
44 | } |
||
45 | 3 | } |
|
46 | |||
47 | /** |
||
48 | * @return array |
||
49 | */ |
||
50 | 2 | public function getUrl() |
|
51 | { |
||
52 | 2 | return $this->url; |
|
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | 1 | public function getIcon() |
|
59 | { |
||
60 | 1 | return $this->icon; |
|
61 | } |
||
62 | |||
63 | /** |
||
64 | * @return string |
||
65 | */ |
||
66 | 1 | public function getLabel() |
|
67 | { |
||
68 | 1 | return $this->label; |
|
69 | } |
||
70 | |||
71 | /** |
||
72 | * @return string |
||
73 | */ |
||
74 | 1 | public function getTemplate() |
|
75 | { |
||
76 | 1 | return $this->template; |
|
77 | } |
||
78 | } |
||
79 |
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.