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

CatchSt   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

1 Method

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