1 | <?php |
||
17 | class MovieCardController extends BaseController |
||
18 | { |
||
19 | /** |
||
20 | * @Route("/api/movies/{id}/cards", methods={"GET"}, requirements={"id"="\d+"}) |
||
21 | * |
||
22 | * @param Request $request |
||
23 | * @param int $id |
||
24 | * @param MovieCardRepository $repository |
||
25 | * |
||
26 | * @return JsonResponse |
||
27 | */ |
||
28 | 1 | public function getMoviesCards(Request $request, int $id, MovieCardRepository $repository) |
|
41 | |||
42 | /** |
||
43 | * Add new recommendation. |
||
44 | * |
||
45 | * @Route("/api/movies/{id}/cards", methods={"POST"}) |
||
46 | * |
||
47 | * @throws \Doctrine\ORM\ORMException |
||
48 | * |
||
49 | * @return JsonResponse |
||
50 | */ |
||
51 | 1 | public function postMoviesCards(Request $request, NewMovieCardRequest $cardRequest, Movie $movie, EntityManagerInterface $em) |
|
73 | |||
74 | /** |
||
75 | * @Route("/api/movies/{movie_id}/cards/{id}", methods={"DELETE"}) |
||
76 | */ |
||
77 | 1 | public function deleteMoviesCards(MovieCard $card, EntityManagerInterface $em) |
|
90 | } |
||
91 |
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: