1 | <?php |
||
13 | class Delete |
||
14 | { |
||
15 | /** |
||
16 | * @var Search |
||
17 | */ |
||
18 | private $search; |
||
19 | |||
20 | /** |
||
21 | * Delete constructor. |
||
22 | * |
||
23 | * @param Search $search |
||
24 | */ |
||
25 | 21 | public function __construct(Search $search) |
|
30 | |||
31 | /** |
||
32 | * Delete |
||
33 | * |
||
34 | * @param Index $index |
||
35 | * @param integer $id |
||
36 | * @param string|boolean $uid |
||
37 | * @return $this |
||
38 | */ |
||
39 | 1 | public function delete(Index $index, $id, $uid = false) |
|
55 | } |
||
56 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.