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

TryCatchSt   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 21
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A compile() 0 11 3
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