Test Failed
Push — master ( 33bfdc...47f867 )
by Kirill
02:32
created

NamedDeferred   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getDefinition() 0 4 1
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Frontend\Deferred;
11
12
use Railt\SDL\Frontend\Context\ContextInterface;
13
use Railt\SDL\Frontend\Definition\DefinitionInterface;
14
use Railt\SDL\IR\Type\TypeNameInterface;
15
16
/**
17
 * Class NamedDeferred
18
 */
19
class NamedDeferred extends Deferred implements Identifiable
20
{
21
    /**
22
     * @var TypeNameInterface
23
     */
24
    private $name;
25
26
    /**
27
     * NamedDeferred constructor.
28
     * @param DefinitionInterface $def
29
     * @param ContextInterface $ctx
30
     * @param \Closure|null $then
31
     */
32
    public function __construct(DefinitionInterface $def, ContextInterface $ctx, \Closure $then = null)
33
    {
34
        $this->name = $def;
0 ignored issues
show
Documentation Bug introduced by
It seems like $def of type object<Railt\SDL\Fronten...on\DefinitionInterface> is incompatible with the declared type object<Railt\SDL\IR\Type\TypeNameInterface> of property $name.

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
36
        parent::__construct($ctx, $then);
37
    }
38
39
    /**
40
     * @return DefinitionInterface
41
     */
42
    public function getDefinition(): DefinitionInterface
43
    {
44
        return $this->name;
45
    }
46
}
47