Completed
Push — master ( 8536ac...566946 )
by Дмитрий
12:19 queued 08:32
created

CatchSt::compile()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 6
c 1
b 0
f 0
nc 3
nop 2
dl 0
loc 10
ccs 0
cts 8
cp 0
crap 12
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
use PHPSA\Compiler\Expression;
11
12
class CatchSt extends AbstractCompiler
13
{
14
    protected $name = '\PhpParser\Node\Stmt\Catch_';
15
16
    /**
17
     * @param \PhpParser\Node\Stmt\Catch_ $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