1 | <?php |
||
16 | class Attribute |
||
17 | { |
||
18 | /** |
||
19 | * @var Attribute |
||
20 | */ |
||
21 | protected $property; |
||
22 | |||
23 | /** |
||
24 | * PropertyFactory constructor. |
||
25 | * @param Property $property |
||
26 | */ |
||
27 | public function __construct(Property $property) |
||
31 | |||
32 | /** |
||
33 | * @return Attribute |
||
34 | */ |
||
35 | public function required(): self |
||
41 | |||
42 | /** |
||
43 | * @return Attribute |
||
44 | */ |
||
45 | public function optional(): self |
||
51 | |||
52 | /** |
||
53 | * @param $rules |
||
54 | * @return Attribute |
||
55 | */ |
||
56 | public function rule($rules): self |
||
62 | |||
63 | /** |
||
64 | * @return Attribute |
||
65 | */ |
||
66 | public function nullable(): self |
||
72 | |||
73 | /** |
||
74 | * @param $value |
||
75 | * @return Attribute |
||
76 | */ |
||
77 | public function default($value): self |
||
83 | |||
84 | /** |
||
85 | * @param Closure $callback |
||
86 | * @return Attribute |
||
87 | */ |
||
88 | public function constraint(Closure $callback): self |
||
94 | |||
95 | /** |
||
96 | * @return Property |
||
97 | */ |
||
98 | public function getProperty(): Property |
||
102 | } |
||
103 |
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..