| Conditions | 9 |
| Paths | 24 |
| Total Lines | 28 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 23 |
| CRAP Score | 9 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 4 | public function compile($stmt, Context $context) |
|
| 21 | { |
||
| 22 | 4 | if (count($stmt->init) > 0) { |
|
| 23 | 1 | foreach ($stmt->init as $cond) { |
|
| 24 | 1 | $context->getExpressionCompiler()->compile($cond); |
|
| 25 | 1 | } |
|
| 26 | 1 | } |
|
| 27 | |||
| 28 | 4 | if (count($stmt->cond) > 0) { |
|
| 29 | 1 | foreach ($stmt->cond as $cond) { |
|
| 30 | 1 | $context->getExpressionCompiler()->compile($cond); |
|
| 31 | 1 | } |
|
| 32 | 1 | } |
|
| 33 | |||
| 34 | 4 | if (count($stmt->loop) > 0) { |
|
| 35 | 1 | foreach ($stmt->loop as $loop) { |
|
| 36 | 1 | $context->getExpressionCompiler()->compile($loop); |
|
| 37 | 1 | } |
|
| 38 | 1 | } |
|
| 39 | |||
| 40 | 4 | if (count($stmt->stmts) > 0) { |
|
| 41 | 1 | foreach ($stmt->stmts as $statement) { |
|
| 42 | 1 | \PHPSA\nodeVisitorFactory($statement, $context); |
|
| 43 | 1 | } |
|
| 44 | 1 | } else { |
|
| 45 | 3 | return $context->notice('not-implemented-body', 'Missing body', $stmt); |
|
| 46 | } |
||
| 47 | 1 | } |
|
| 48 | } |
||
| 49 |