1 | <?php |
||
13 | class LazyProperty |
||
14 | { |
||
15 | /** |
||
16 | * @var Name |
||
17 | */ |
||
18 | private $name; |
||
19 | |||
20 | /** |
||
21 | * @var ValueInitializer |
||
22 | */ |
||
23 | private $valueInitializer; |
||
24 | |||
25 | /** |
||
26 | * @var array|Method[] $triggers |
||
27 | */ |
||
28 | private $triggers; |
||
29 | |||
30 | /** |
||
31 | * @var \Closure |
||
32 | */ |
||
33 | private $initializationCallback; |
||
34 | |||
35 | /** |
||
36 | * @param Name $name |
||
37 | * @param ValueInitializer $valueInitializer |
||
38 | * @param array|Method[] $triggers |
||
39 | * @throws InvalidArgumentException |
||
40 | */ |
||
41 | public function __construct(Name $name, ValueInitializer $valueInitializer, $triggers = []) |
||
53 | |||
54 | /** |
||
55 | * @return ValueInitializer |
||
56 | * |
||
57 | * @api |
||
58 | */ |
||
59 | public function getValueInitializer() |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | * |
||
67 | * @api |
||
68 | */ |
||
69 | public function getName() |
||
73 | |||
74 | /** |
||
75 | * @return bool |
||
76 | * |
||
77 | * @api |
||
78 | */ |
||
79 | public function hasTriggers() |
||
83 | |||
84 | /** |
||
85 | * @param $methodName |
||
86 | * @return bool |
||
87 | * |
||
88 | * @api |
||
89 | */ |
||
90 | public function isTriggeredBy($methodName) |
||
100 | |||
101 | /** |
||
102 | * @param InitializationCallback $initializationCallback |
||
103 | * |
||
104 | * @api |
||
105 | */ |
||
106 | public function setInitializationCallback(InitializationCallback $initializationCallback) |
||
110 | |||
111 | /** |
||
112 | * @return bool |
||
113 | * |
||
114 | * @api |
||
115 | */ |
||
116 | public function hasInitializationCallback() |
||
120 | |||
121 | /** |
||
122 | * @return InitializationCallback |
||
123 | * |
||
124 | * @api |
||
125 | */ |
||
126 | public function getInitializationCallback() |
||
130 | } |
||
131 |
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..