1 | <?php |
||
15 | class BaseMenu extends AbstractEntity |
||
16 | { |
||
17 | /** |
||
18 | * @var string |
||
19 | * |
||
20 | * @ORM\Column(name="name", type="string", length=25, nullable=true) |
||
21 | * @Assert\NotBlank() |
||
22 | */ |
||
23 | protected $name; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | * |
||
28 | * @ORM\Column(name="locale", type="string", length=5, nullable=true) |
||
29 | * @Assert\NotBlank() |
||
30 | */ |
||
31 | protected $locale; |
||
32 | |||
33 | /** |
||
34 | * @var ArrayCollection |
||
35 | * |
||
36 | * @ORM\OneToMany(targetEntity="Kunstmaan\MenuBundle\Entity\MenuItem", mappedBy="menu", cascade={"persist", "remove"}, orphanRemoval=true) |
||
37 | */ |
||
38 | protected $items; |
||
39 | |||
40 | /** |
||
41 | * Constructor |
||
42 | */ |
||
43 | 2 | public function __construct() |
|
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | 1 | public function getName() |
|
55 | |||
56 | /** |
||
57 | * @param string $name |
||
58 | * |
||
59 | * @return Menu |
||
60 | */ |
||
61 | 1 | public function setName($name) |
|
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | 1 | public function getLocale() |
|
75 | |||
76 | /** |
||
77 | * @param string $locale |
||
78 | * |
||
79 | * @return Menu |
||
80 | */ |
||
81 | 1 | public function setLocale($locale) |
|
87 | |||
88 | /** |
||
89 | * @return ArrayCollection |
||
90 | */ |
||
91 | 1 | public function getItems() |
|
95 | |||
96 | /** |
||
97 | * @param ArrayCollection $items |
||
98 | * |
||
99 | * @return Menu |
||
100 | */ |
||
101 | 1 | public function setItems($items) |
|
107 | |||
108 | /** |
||
109 | * @param MenuItem $item |
||
110 | */ |
||
111 | 1 | public function addItem(MenuItem $item) |
|
117 | |||
118 | /** |
||
119 | * @param MenuItem $item |
||
120 | */ |
||
121 | 1 | public function removeItem(MenuItem $item) |
|
125 | } |
||
126 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.