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

StatementBeforeCompile   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getContext() 0 4 1
A getStatement() 0 4 1
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