Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
59 | public function run() |
||
60 | { |
||
61 | $statement = $this->__invoke(); |
||
62 | $statement->setFetchMode(PDO::FETCH_ASSOC); |
||
63 | |||
64 | if ($this->one) { |
||
65 | $data = $statement->fetch(); |
||
66 | |||
67 | return $data ? $this->createRow($data) : null; |
||
68 | } |
||
69 | |||
70 | $rows = array_map(Closure::fromCallable([$this, 'createRow']), $statement->fetchAll()); |
||
71 | |||
72 | return $this->table->createCollection($rows); |
||
73 | } |
||
74 | |||
92 |
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: