1 | <?php |
||
8 | class JsonApiHydrator extends ArrayHydrator |
||
9 | { |
||
10 | /** |
||
11 | * @param $entity |
||
12 | * @param $data |
||
13 | * |
||
14 | * @return object |
||
15 | */ |
||
16 | protected function hydrateProperties($entity, $data) |
||
24 | |||
25 | /** |
||
26 | * Map JSON API resource relations to doctrine entity. |
||
27 | * |
||
28 | * @param object $entity |
||
29 | * @param array $data |
||
30 | * |
||
31 | * @return mixed |
||
32 | * @throws \Exception |
||
33 | */ |
||
34 | protected function hydrateAssociations($entity, $data) |
||
60 | |||
61 | /** |
||
62 | * @param array $data |
||
63 | * |
||
64 | * @return array |
||
65 | */ |
||
66 | protected function mapRelationshipsArray(array $data) |
||
75 | |||
76 | /** |
||
77 | * @param array $data |
||
78 | * |
||
79 | * @return int|null |
||
80 | */ |
||
81 | protected function getResourceId(array $data) |
||
89 | } |
||
90 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: