Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
60 | public function run() |
||
61 | { |
||
62 | $statement = $this->__invoke(); |
||
63 | $statement->setFetchMode(PDO::FETCH_ASSOC); |
||
64 | |||
65 | $dataFields = []; |
||
66 | |||
67 | if ($this->one) { |
||
68 | $data = $statement->fetch(); |
||
69 | |||
70 | return $data ? $this->createRow($data) : null; |
||
71 | } |
||
72 | |||
73 | $rows = array_map(Closure::fromCallable([$this, 'createRow']), $statement->fetchAll()); |
||
74 | |||
75 | return $this->table->createCollection($rows); |
||
76 | } |
||
77 | |||
95 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: