1 | <?php |
||
31 | class MovieController extends BaseController |
||
32 | { |
||
33 | /** |
||
34 | * Get all movies. |
||
35 | * |
||
36 | * @Route("/api/movies", methods={"GET"}) |
||
37 | * |
||
38 | * @param Request $request |
||
39 | * @param MovieRepository $movieRepository |
||
40 | * |
||
41 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
42 | */ |
||
43 | 4 | public function getAll(Request $request, MovieRepository $movieRepository) |
|
62 | |||
63 | /** |
||
64 | * Get movie resource. |
||
65 | * |
||
66 | * @Route("/api/movies/{id}", methods={"GET"}) |
||
67 | * |
||
68 | * @param Movie $movie |
||
69 | * @param ProducerInterface $producer |
||
70 | * |
||
71 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
72 | */ |
||
73 | public function getMovies(Movie $movie, ProducerInterface $producer) |
||
83 | |||
84 | /** |
||
85 | * Get movies by title. |
||
86 | * |
||
87 | * @Route("/api/movies/search", methods={"POST"}) |
||
88 | * |
||
89 | * @param SearchRequest $request |
||
90 | * @param SearchService $searchService |
||
91 | * @param Request $currentRequest |
||
92 | * |
||
93 | * @throws \Exception |
||
94 | * |
||
95 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
96 | */ |
||
97 | 2 | public function getSearch(SearchRequest $request, SearchService $searchService, Request $currentRequest) |
|
109 | |||
110 | /** |
||
111 | * Create new movie. |
||
112 | * |
||
113 | * @Route("/api/movies", methods={"POST"}) |
||
114 | * |
||
115 | * @param CreateMovieRequest $request |
||
116 | * @param MovieManageService $service |
||
117 | * @param ValidatorInterface $validator |
||
118 | * |
||
119 | * @throws \Exception |
||
120 | * |
||
121 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
122 | */ |
||
123 | 2 | public function postMovies(CreateMovieRequest $request, MovieManageService $service, ValidatorInterface $validator) |
|
142 | |||
143 | /** |
||
144 | * Add new recommendation. |
||
145 | * |
||
146 | * @Route("/api/movies/{id}/recommendations", methods={"POST"}) |
||
147 | |||
148 | * |
||
149 | * @param NewMovieRecommendationRequest $request |
||
150 | * @param Movie $originalMovie |
||
151 | * @param EntityManagerInterface $em |
||
152 | * @param ProducerInterface $producer |
||
153 | * |
||
154 | * @throws \Doctrine\ORM\ORMException |
||
155 | * |
||
156 | * @return JsonResponse |
||
157 | */ |
||
158 | 1 | public function postMoviesRecommendations(NewMovieRecommendationRequest $request, Movie $originalMovie, EntityManagerInterface $em, ProducerInterface $producer) |
|
191 | |||
192 | /** |
||
193 | * @Route("/api/movies/{id}/recommendations", methods={"GET"}) |
||
194 | * |
||
195 | * @param Movie $movie |
||
196 | * @param MovieRepository $movieRepository |
||
197 | * @param MovieRecommendationRepository $repository |
||
198 | * |
||
199 | * @throws \Doctrine\DBAL\DBALException |
||
200 | * |
||
201 | * @return JsonResponse |
||
202 | */ |
||
203 | public function getMoviesRecommendations(Movie $movie, MovieRepository $movieRepository, MovieRecommendationRepository $repository) |
||
228 | |||
229 | /** |
||
230 | * @Route("/api/recommendations", methods={"GET"}) |
||
231 | * |
||
232 | * @param Request $request |
||
233 | * @param MovieRecommendationRepository $repository |
||
234 | * |
||
235 | * @return JsonResponse |
||
236 | */ |
||
237 | public function getAllRecommendations(Request $request, MovieRecommendationRepository $repository) |
||
252 | } |
||
253 |
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: