1 | <?php |
||
11 | class FractalService implements FractalServiceContract |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $includes = []; |
||
18 | |||
19 | /** |
||
20 | * @var SerializerAbstract |
||
21 | */ |
||
22 | private $defaultSerializer; |
||
23 | |||
24 | |||
25 | /** |
||
26 | * @inheritdoc |
||
27 | */ |
||
28 | public function item($data, TransformerAbstract $transformer = null, $resourceKey = null) |
||
32 | |||
33 | |||
34 | /** |
||
35 | * @inheritdoc |
||
36 | */ |
||
37 | public function collection($data, TransformerAbstract $transformer = null, $resourceKey = null) |
||
41 | |||
42 | |||
43 | /** |
||
44 | * @inheritdoc |
||
45 | */ |
||
46 | public function parseIncludes($includes) |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @inheritdoc |
||
58 | */ |
||
59 | public function setDefaultSerializer(SerializerAbstract $serializer) |
||
63 | |||
64 | |||
65 | /** |
||
66 | * Creates a builder for serializing data. |
||
67 | * |
||
68 | * @param array $resourceClass |
||
69 | * @param mixed $data |
||
70 | * @param TransformerAbstract|null $transformer |
||
71 | * @param string|null $resourceKey |
||
72 | * |
||
73 | * @return FractalBuilder |
||
74 | */ |
||
75 | protected function makeBuilder( |
||
94 | |||
95 | |||
96 | /** |
||
97 | * @return Manager |
||
98 | */ |
||
99 | protected function makeFractal() |
||
113 | } |
||
114 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: