Completed
Pull Request — master (#150)
by Дмитрий
03:17
created

StatementAfterCompile::getContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
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 StatementAfterCompile extends \Webiny\Component\EventManager\Event
11
{
12
    const EVENT_NAME = 'statement.after-compile';
13
14
    /**
15
     * @var Context
16
     */
17
    protected $context;
18
19
    /**
20
     * @var \PhpParser\Node\Expr
21
     */
22
    protected $statement;
23
24
    /**
25
     * @var mixed
26
     */
27
    protected $result;
28
29
    public function __construct(\PhpParser\Node\Stmt $statement, Context $context, $result)
30
    {
31
        parent::__construct();
32
33
        $this->context = $context;
34
        $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...
35
        $this->result = $result;
36
    }
37
38
    /**
39
     * @return Context
40
     */
41
    public function getContext()
42
    {
43
        return $this->context;
44
    }
45
46
    /**
47
     * @return \PhpParser\Node\Expr
48
     */
49
    public function getStatement()
50
    {
51
        return $this->statement;
52
    }
53
54
    /**
55
     * @return mixed
56
     */
57
    public function getResult()
58
    {
59
        return $this->result;
60
    }
61
}
62