1 | <?php |
||
36 | class MovieController extends BaseController |
||
37 | { |
||
38 | /** |
||
39 | * Get all movies. |
||
40 | * |
||
41 | * @Route("/api/movies", methods={"GET"}) |
||
42 | * |
||
43 | * @param Request $request |
||
44 | * @param MovieRepository $movieRepository |
||
45 | * |
||
46 | * @throws |
||
47 | * |
||
48 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
49 | */ |
||
50 | 34 | public function getAll(Request $request, MovieRepository $movieRepository) |
|
75 | |||
76 | /** |
||
77 | * Get movie resource. |
||
78 | * |
||
79 | * @Route("/api/movies/{id}", methods={"GET"}, requirements={"id"="\d+"}) |
||
80 | * |
||
81 | * @param int $id |
||
82 | * @param MovieRepository $repository |
||
83 | * @param ProducerInterface $producer |
||
84 | * |
||
85 | * @throws \Doctrine\ORM\NoResultException |
||
86 | * @throws \Doctrine\ORM\NonUniqueResultException |
||
87 | * |
||
88 | * @return JsonResponse |
||
89 | */ |
||
90 | 2 | public function getMovies(int $id, MovieRepository $repository, ProducerInterface $producer) |
|
104 | |||
105 | /** |
||
106 | * @Route("/api/movies/{movieId}/releaseDate/{countryCode}", methods={"GET"}, requirements={"movieId"="\d+"}) |
||
107 | * @ParamConverter("country", options={"mapping": {"countryCode": "code"}}) |
||
108 | */ |
||
109 | public function getMovieReleaseDate(int $movieId, Country $country, MovieReleaseDateRepository $repository) |
||
119 | |||
120 | /** |
||
121 | * @Route("/api/movies/{id}/updatePoster", methods={"POST"}, requirements={"id"="\d+"}) |
||
122 | * |
||
123 | * @param Movie $movie |
||
124 | * @param UpdatePosterRequest $request |
||
125 | * |
||
126 | * @return JsonResponse |
||
127 | */ |
||
128 | 1 | public function postMoviesUpdatePoster(Movie $movie, UpdatePosterRequest $request) |
|
141 | |||
142 | /** |
||
143 | * Get movies by title. |
||
144 | * |
||
145 | * @Route("/api/movies/search", methods={"POST"}) |
||
146 | * |
||
147 | * @param SearchRequest $request |
||
148 | * @param SearchService $searchService |
||
149 | * @param Request $currentRequest |
||
150 | * |
||
151 | * @throws \Exception |
||
152 | * |
||
153 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
154 | */ |
||
155 | 2 | public function getSearch(SearchRequest $request, SearchService $searchService, Request $currentRequest) |
|
167 | |||
168 | /** |
||
169 | * Create new movie. |
||
170 | * |
||
171 | * @Route("/api/movies", methods={"POST"}) |
||
172 | * |
||
173 | * @param CreateMovieRequest $request |
||
174 | * @param MovieManageService $service |
||
175 | * @param ValidatorInterface $validator |
||
176 | * |
||
177 | * @throws \Exception |
||
178 | * |
||
179 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
180 | */ |
||
181 | 2 | public function postMovies(CreateMovieRequest $request, MovieManageService $service, ValidatorInterface $validator) |
|
200 | |||
201 | /** |
||
202 | * @Route("/api/movies/{id}", methods={"POST", "PUT", "PATCH"}, requirements={"id"="\d+"}) |
||
203 | * |
||
204 | * @param Movie $movie |
||
205 | * @param UpdateMovieRequest $request |
||
206 | * |
||
207 | * @throws \ErrorException |
||
208 | * @throws \Exception |
||
209 | * |
||
210 | * @return JsonResponse |
||
211 | */ |
||
212 | 2 | public function putMovies(Movie $movie, UpdateMovieRequest $request) |
|
245 | } |
||
246 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.