Completed
Push — master ( b7cb0e...ffcfdb )
by Дмитрий
02:53
created

StatementBeforeCompile::getStatement()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
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\Expr
21
     */
22
    private $statement;
23
24 6
    public function __construct(\PhpParser\Node\Stmt $statement, Context $context)
25
    {
26 6
        parent::__construct();
27
28 6
        $this->context = $context;
29 6
        $this->statement = $statement;
0 ignored issues
show
Documentation Bug introduced by
It seems like $statement of type object<PhpParser\Node\Stmt> is incompatible with the declared type object<PhpParser\Node\Expr> of property $statement.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
30 6
    }
31
32
    /**
33
     * @return Context
34
     */
35 6
    public function getContext()
36
    {
37 6
        return $this->context;
38
    }
39
40
    /**
41
     * @return \PhpParser\Node\Expr
42
     */
43 6
    public function getStatement()
44
    {
45 6
        return $this->statement;
46
    }
47
}
48