| Conditions | 5 |
| Paths | 12 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5.7283 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 2 | public function compile($statement, Context $context) |
|
| 21 | { |
||
| 22 | 2 | foreach ($statement->stmts as $stmt) { |
|
| 23 | 2 | \PHPSA\nodeVisitorFactory($stmt, $context); |
|
| 24 | 2 | } |
|
| 25 | |||
| 26 | 2 | foreach ($statement->catches as $stmt) { |
|
| 27 | 2 | \PHPSA\nodeVisitorFactory($stmt, $context); |
|
| 28 | 2 | } |
|
| 29 | |||
| 30 | 2 | if (count($statement->finallyStmts) > 0) { |
|
| 31 | foreach ($statement->finallyStmts as $stmt) { |
||
|
|
|||
| 32 | \PHPSA\nodeVisitorFactory($stmt, $context); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | 2 | } |
|
| 36 | } |
||
| 37 |
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.