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

EchoSt::compile()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 5
c 1
b 0
f 0
nc 3
nop 2
dl 0
loc 10
ccs 8
cts 8
cp 1
crap 3
rs 9.4285
1
<?php
2
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA\Compiler\Statement;
7
8
use PHPSA\CompiledExpression;
9
use PHPSA\Context;
10
11
class EchoSt extends AbstractCompiler
12
{
13
    protected $name = '\PhpParser\Node\Stmt\Echo_';
14
15
    /**
16
     * @param \PhpParser\Node\Stmt\Echo_ $stmt
17
     * @param Context $context
18
     * @return CompiledExpression
19
     */
20 1
    public function compile($stmt, Context $context)
21
    {
22 1
        $compiler = $context->getExpressionCompiler();
23
24 1
        if (count($stmt->exprs) > 0) {
25 1
            foreach ($stmt->exprs as $expr) {
26 1
                $compiler->compile($expr);
27 1
            }
28 1
        }
29 1
    }
30
}
31