StatementBeforeCompile::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 7
ccs 0
cts 5
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA\Compiler\Event;
7
8
use PHPSA\Context;
9
10
class StatementBeforeCompile extends \Webiny\Component\EventManager\Event
11
{
12
    const EVENT_NAME = 'statement.before-compile';
13
14
    /**
15
     * @var Context
16
     */
17
    private $context;
18
19
    /**
20
     * @var \PhpParser\Node\Stmt
21
     */
22
    private $statement;
23
24
    public function __construct(\PhpParser\Node\Stmt $statement, Context $context)
25
    {
26
        parent::__construct();
27
28
        $this->context = $context;
29
        $this->statement = $statement;
30
    }
31
32
    /**
33
     * @return Context
34
     */
35
    public function getContext()
36
    {
37
        return $this->context;
38
    }
39
40
    /**
41
     * @return \PhpParser\Node\Expr
42
     */
43
    public function getStatement()
44
    {
45
        return $this->statement;
46
    }
47
}
48