1 | <?php |
||
19 | class BodyMapping implements ResponseTransformationInterface, RequestTransformationInterface |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $mapping = []; |
||
26 | |||
27 | /** |
||
28 | * @var MappingTransformer |
||
29 | */ |
||
30 | private $transformer; |
||
31 | |||
32 | /** |
||
33 | * Constructor |
||
34 | * |
||
35 | * @param MappingTransformer $transformer The MappingTransformer to be used for the transformations |
||
36 | */ |
||
37 | public function __construct(MappingTransformer $transformer) |
||
41 | |||
42 | /** |
||
43 | * Transforms a response |
||
44 | * |
||
45 | * @param Response $responseIn The original response object |
||
46 | * @param Response $responseOut The response object to transform |
||
47 | * |
||
48 | * @return void |
||
49 | */ |
||
50 | public function transformResponse(Response $responseIn, Response $responseOut) |
||
56 | |||
57 | /** |
||
58 | * Transforms a request |
||
59 | * |
||
60 | * @param Request $requestIn The original request object |
||
61 | * @param Request $requestOut The request object to transform |
||
62 | * @return Request The transformed request |
||
63 | */ |
||
64 | public function transformRequest(Request $requestIn, Request $requestOut) |
||
79 | |||
80 | /** |
||
81 | * Sets the mapping |
||
82 | * |
||
83 | * Structure: $transformedPropertyPath => $originalPropertyPath |
||
84 | * |
||
85 | * @see http://symfony.com/doc/current/components/property_access/introduction.html |
||
86 | * |
||
87 | * @param array $mapping The mapping |
||
88 | * |
||
89 | * @return void |
||
90 | */ |
||
91 | public function setMapping(array $mapping) |
||
95 | } |
||
96 |
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: