TryCatchSt   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A compile() 0 14 4
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 TryCatchSt extends AbstractCompiler
12
{
13
    protected $name = '\PhpParser\Node\Stmt\TryCatch';
14
15
    /**
16
     * @param \PhpParser\Node\Stmt\TryCatch $statement
17
     * @param Context $context
18
     * @return CompiledExpression
19
     */
20
    public function compile($statement, Context $context)
21
    {
22
        foreach ($statement->stmts as $stmt) {
23
            \PHPSA\nodeVisitorFactory($stmt, $context);
24
        }
25
26
        foreach ($statement->catches as $stmt) {
27
            \PHPSA\nodeVisitorFactory($stmt, $context);
28
        }
29
30
        if ($statement->finally !== null) {
31
            \PHPSA\nodeVisitorFactory($statement->finally, $context);
32
        }
33
    }
34
}
35