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