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