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