| Conditions | 6 |
| Paths | 8 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 6.0087 |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 20 | 1 | public function compile($stmt, Context $context) |
|
| 21 | { |
||
| 22 | 1 | $context->getExpressionCompiler()->compile($stmt->cond); |
|
| 23 | |||
| 24 | 1 | if (count($stmt->cases)) { |
|
| 25 | 1 | foreach ($stmt->cases as $case) { |
|
| 26 | 1 | if ($case->cond) { |
|
| 27 | 1 | $context->getExpressionCompiler()->compile($case->cond); |
|
| 28 | 1 | } |
|
| 29 | |||
| 30 | 1 | if (count($case->stmts)) { |
|
| 31 | 1 | foreach ($case->stmts as $caseStatements) { |
|
| 32 | 1 | \PHPSA\nodeVisitorFactory($caseStatements, $context); |
|
| 33 | 1 | } |
|
| 34 | 1 | } |
|
| 35 | 1 | } |
|
| 36 | 1 | } else { |
|
| 37 | $context->notice('switch.empty', 'Switch block is empty, lol', $stmt); |
||
| 38 | } |
||
| 39 | 1 | } |
|
| 40 | } |
||
| 41 |