Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
78 | private function createRow(array $data): Row |
||
79 | { |
||
80 | $values = []; |
||
81 | $extraData = []; |
||
82 | $fields = $this->table->getFields(); |
||
83 | |||
84 | foreach ($data as $name => $value) { |
||
85 | if (isset($fields[$name])) { |
||
86 | $values[$name] = $fields[$name]->format($value); |
||
87 | } else { |
||
88 | $extraData[$name] = $value; |
||
89 | } |
||
90 | } |
||
91 | |||
92 | return $this->table->create($values)->setData($extraData); |
||
93 | } |
||
94 | } |
||
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: