| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public static function extendException(TDBMInheritanceException $e, TDBMService $tdbmService, array $beanData) |
||
| 16 | { |
||
| 17 | $pks = []; |
||
| 18 | foreach ($beanData as $table => $row) { |
||
| 19 | $primaryKeyColumns = $tdbmService->getPrimaryKeyColumns($table); |
||
| 20 | foreach ($primaryKeyColumns as $columnName) { |
||
|
|
|||
| 21 | if ($row[$columnName] !== null) { |
||
| 22 | $pks[] = $table.'.'.$columnName.' => '.var_export($row[$columnName], true); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | } |
||
| 26 | |||
| 27 | throw new self($e->getMessage().' (row in error: '.implode(', ', $pks).')', 0, $e); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |
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.