| Conditions | 4 |
| Paths | 8 |
| Total Lines | 24 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | 10 | public function compile($ifStatement, Context $context) |
|
| 22 | { |
||
| 23 | 10 | $context->setCurrentBranch(Variable::BRANCH_CONDITIONAL_TRUE); |
|
| 24 | |||
| 25 | 10 | $context->getExpressionCompiler()->compile($ifStatement->cond); |
|
| 26 | |||
| 27 | 10 | foreach ($ifStatement->stmts as $stmt) { |
|
| 28 | 7 | \PHPSA\nodeVisitorFactory($stmt, $context); |
|
| 29 | 10 | } |
|
| 30 | |||
| 31 | 10 | $context->setCurrentBranch(Variable::BRANCH_CONDITIONAL_EXTERNAL); |
|
| 32 | |||
| 33 | 10 | foreach ($ifStatement->elseifs as $elseIfStatement) { |
|
| 34 | 4 | \PHPSA\nodeVisitorFactory($elseIfStatement, $context); |
|
| 35 | 10 | } |
|
| 36 | |||
| 37 | 10 | $context->setCurrentBranch(Variable::BRANCH_CONDITIONAL_FALSE); |
|
| 38 | |||
| 39 | 10 | if ($ifStatement->else) { |
|
| 40 | 2 | \PHPSA\nodeVisitorFactory($ifStatement->else, $context); |
|
| 41 | 2 | } |
|
| 42 | |||
| 43 | 10 | $context->setCurrentBranch(Variable::BRANCH_ROOT); |
|
| 44 | 10 | } |
|
| 45 | } |
||
| 46 |