Completed
Pull Request — master (#229)
by Enrico
06:28
created

ElseIfSt::compile()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 8
ccs 6
cts 6
cp 1
crap 2
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
namespace PHPSA\Compiler\Statement;
4
5
use PHPSA\Context;
6
7
class ElseIfSt extends AbstractCompiler
8
{
9
    protected $name = '\PhpParser\Node\Stmt\ElseIf_';
10
11
    /**
12
     * @param \PhpParser\Node\Stmt\ElseIf_ $elseIfStatement
13
     * @param Context $context
14
     */
15 4
    public function compile($elseIfStatement, Context $context)
16
    {
17 4
        $context->getExpressionCompiler()->compile($elseIfStatement->cond);
18
19 4
        foreach ($elseIfStatement->stmts as $stmt) {
20 4
            \PHPSA\nodeVisitorFactory($stmt, $context);
21 4
        }
22 4
    }
23
}
24