1 | <?php |
||
26 | final class GetItemAction |
||
27 | { |
||
28 | /** |
||
29 | * @var ItemDataProvider |
||
30 | */ |
||
31 | private $itemDataProvider; |
||
32 | |||
33 | /** |
||
34 | * @var RequestAttributesExtractorInterface |
||
35 | */ |
||
36 | private $attributesExtractor; |
||
37 | |||
38 | public function __construct(ItemDataProviderInterface $itemDataProvider, RequestAttributesExtractorInterface $attributesExtractor) |
||
43 | |||
44 | /** |
||
45 | * Retrieves an item. |
||
46 | * |
||
47 | * @param Request $request |
||
48 | * @param string|int $id |
||
49 | * |
||
50 | * @throws NotFoundHttpException |
||
51 | * @throws RuntimeException |
||
52 | * |
||
53 | * @return mixed |
||
54 | */ |
||
55 | public function __invoke(Request $request, $id) |
||
66 | } |
||
67 |
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: