1 | <?php |
||
30 | class MovieController extends BaseController |
||
31 | { |
||
32 | /** |
||
33 | * Get all movies. |
||
34 | * |
||
35 | * @Route("/api/movies", methods={"GET"}) |
||
36 | * |
||
37 | * @param Request $request |
||
38 | * @param MovieRepository $movieRepository |
||
39 | * |
||
40 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
41 | */ |
||
42 | 4 | public function getAll(Request $request, MovieRepository $movieRepository) |
|
61 | |||
62 | /** |
||
63 | * Get movie resource. |
||
64 | * |
||
65 | * @Route("/api/movies/{id}", methods={"GET"}) |
||
66 | * |
||
67 | * @param Movie $movie |
||
68 | * |
||
69 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
70 | */ |
||
71 | public function getMovies(Movie $movie) |
||
77 | |||
78 | /** |
||
79 | * Get movies by title. |
||
80 | * |
||
81 | * @Route("/api/movies/search", methods={"POST"}) |
||
82 | * |
||
83 | * @param SearchRequest $request |
||
84 | * @param SearchService $searchService |
||
85 | * @param Request $currentRequest |
||
86 | * |
||
87 | * @throws \Exception |
||
88 | * |
||
89 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
90 | */ |
||
91 | 2 | public function getSearch(SearchRequest $request, SearchService $searchService, Request $currentRequest) |
|
103 | |||
104 | /** |
||
105 | * Create new movie. |
||
106 | * |
||
107 | * @Route("/api/movies", methods={"POST"}) |
||
108 | * |
||
109 | * @param CreateMovieRequest $request |
||
110 | * @param MovieManageService $service |
||
111 | * @param ValidatorInterface $validator |
||
112 | * |
||
113 | * @throws \Exception |
||
114 | * |
||
115 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
116 | */ |
||
117 | 2 | public function postMovies(CreateMovieRequest $request, MovieManageService $service, ValidatorInterface $validator) |
|
136 | |||
137 | /** |
||
138 | * Add new recommendation |
||
139 | * |
||
140 | * @Route("/api/movies/{id}/recommendations", methods={"POST"}) |
||
141 | |||
142 | * @param NewMovieRecommendationRequest $request |
||
143 | * @param Movie $originalMovie |
||
144 | * @param EntityManagerInterface $em |
||
145 | * @param ProducerInterface $producer |
||
146 | * @return JsonResponse |
||
147 | * @throws \Doctrine\ORM\ORMException |
||
148 | */ |
||
149 | 1 | public function postMoviesRecommendations(NewMovieRecommendationRequest $request, Movie $originalMovie, EntityManagerInterface $em, ProducerInterface $producer) |
|
182 | |||
183 | /** |
||
184 | * @Route("/api/movies/{id}/recommendations", methods={"GET"}) |
||
185 | */ |
||
186 | public function getMoviesRecommendations(Movie $movie, MovieRecommendationRepository $repository) |
||
192 | } |
||
193 |
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: