1 | <?php |
||
10 | class Caster implements CastManagerInterface |
||
11 | { |
||
12 | /** @var \Wandu\Caster\CasterInterface[] */ |
||
13 | protected $casters = []; |
||
14 | |||
15 | /** |
||
16 | * @param \Wandu\Caster\CasterInterface[] $casters |
||
17 | */ |
||
18 | 80 | public function __construct(array $casters = []) |
|
22 | |||
23 | /** |
||
24 | * {@inheritdoc} |
||
25 | */ |
||
26 | 1 | public function addCaster(string $type, CasterInterface $caster) |
|
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | 80 | public function cast($value, string $type) |
|
49 | |||
50 | /** |
||
51 | * @param string $type |
||
52 | * @param string $originType |
||
53 | * @return \Wandu\Caster\CasterInterface |
||
54 | */ |
||
55 | 66 | protected function getCaster(string $type, string $originType): CasterInterface |
|
62 | |||
63 | /** |
||
64 | * @param string $type |
||
65 | * @return bool |
||
66 | */ |
||
67 | 66 | protected function isArrayable($type): bool |
|
71 | |||
72 | /** |
||
73 | * @param string $type |
||
74 | * @return bool |
||
75 | */ |
||
76 | 80 | protected function isNullable($type): bool |
|
80 | |||
81 | /** |
||
82 | * @return \Wandu\Caster\CasterInterface[] |
||
83 | */ |
||
84 | 80 | protected function getDefaultCasters() |
|
104 | } |
||
105 |
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..