Completed
Push — master ( f188aa...a2fcca )
by Дмитрий
41:46
created

TryCatchSt::compile()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
ccs 0
cts 8
cp 0
rs 9.4285
cc 3
eloc 6
nc 3
nop 2
crap 12
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
use PHPSA\Compiler\Expression;
11
12
class TryCatchSt extends AbstractCompiler
13
{
14
    protected $name = '\PhpParser\Node\Stmt\TryCatch';
15
16
    /**
17
     * @param \PhpParser\Node\Stmt\TryCatch $statement
18
     * @param Context $context
19
     * @return CompiledExpression
20
     */
21
    public function compile($statement, Context $context)
22
    {
23
        if (count($statement->stmts) > 0) {
24
            foreach ($statement->stmts as $stmt) {
25
                \PHPSA\nodeVisitorFactory($stmt, $context);
26
            }
27
        } else {
28
            $context->notice('not-implemented-body', 'Missing body', $statement);
29
        }
30
31
    }
32
}
33