1 | <?php |
||
13 | class InvoiceItemsStrategy implements StrategyInterface |
||
14 | { |
||
15 | /** @var ClassMethods */ |
||
16 | private $hydrator; |
||
17 | |||
18 | /** |
||
19 | * InvoiceItemsStrategy constructor. |
||
20 | * |
||
21 | * @param HydratorInterface $hydrator |
||
22 | */ |
||
23 | public function __construct(HydratorInterface $hydrator) |
||
27 | |||
28 | /** |
||
29 | * Converts the given value so that it can be extracted by the hydrator. |
||
30 | * |
||
31 | * @param ContactInterface[] $value The original value. |
||
32 | * |
||
33 | * @return array Returns the value that should be extracted. |
||
34 | * @throws BadMethodCallException for a non-object $contactObj |
||
35 | */ |
||
36 | public function extract($value) |
||
45 | |||
46 | /** |
||
47 | * Converts the given value so that it can be hydrated by the hydrator. |
||
48 | * @param array $value |
||
49 | * |
||
50 | * @return ContactInterface[] |
||
51 | * @throws BadMethodCallException for a non-object $contactObj |
||
52 | */ |
||
53 | public function hydrate($value) |
||
65 | } |
||
66 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.