Completed
Pull Request — master (#149)
by Enrico
04:04
created

ConstSt::compile()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 3
nop 2
dl 0
loc 10
ccs 0
cts 8
cp 0
crap 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace PHPSA\Compiler\Statement;
4
5
use PHPSA\CompiledExpression;
6
use PHPSA\Context;
7
8
class ConstSt extends AbstractCompiler
9
{
10
    protected $name = '\PhpParser\Node\Stmt\Const_';
11
12
    /**
13
     * @param \PhpParser\Node\Stmt\Const_ $stmt
14
     * @param Context $context
15
     * @return CompiledExpression
16
     */
17
    public function compile($stmt, Context $context)
18
    {
19
        $compiler = $context->getExpressionCompiler();
20
21
        if (count($stmt->consts) > 0) {
22
            foreach ($stmt->consts as $const) {
23
                $compiler->compile($const->value);
24
            }
25
        }
26
    }
27
}
28