| 1 | <?php |
||
| 18 | class Attribute |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var Attribute |
||
| 22 | */ |
||
| 23 | protected $property; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * PropertyFactory constructor. |
||
| 27 | * @param Property $property |
||
| 28 | */ |
||
| 29 | public function __construct(Property $property) |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return Attribute |
||
| 36 | */ |
||
| 37 | public function required(): self |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return Attribute |
||
| 45 | */ |
||
| 46 | public function optional(): self |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @param $rules |
||
| 54 | * @return Attribute |
||
| 55 | */ |
||
| 56 | public function rule($rules): self |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return Attribute |
||
| 64 | */ |
||
| 65 | public function nullable(): self |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @param $value |
||
| 73 | * @return Attribute |
||
| 74 | */ |
||
| 75 | public function default($value): self |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @param Closure $callback |
||
| 83 | * @return Attribute |
||
| 84 | */ |
||
| 85 | public function constraint(Closure $callback): self |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @return Property |
||
| 93 | */ |
||
| 94 | public function getProperty(): Property |
||
| 98 | |||
| 99 | } |
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..