1 | <?php |
||
33 | class MovieController extends BaseController |
||
34 | { |
||
35 | /** |
||
36 | * Get all movies. |
||
37 | * |
||
38 | * @Route("/api/movies", methods={"GET"}) |
||
39 | * |
||
40 | * @param Request $request |
||
41 | * @param MovieRepository $movieRepository |
||
42 | * |
||
43 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
44 | */ |
||
45 | 17 | public function getAll(Request $request, MovieRepository $movieRepository) |
|
56 | |||
57 | /** |
||
58 | * Get movie resource. |
||
59 | * |
||
60 | * @Route("/api/movies/{id}", methods={"GET"}, requirements={"id"="\d+"}) |
||
61 | * |
||
62 | * @param int $id |
||
63 | * @param MovieRepository $repository |
||
64 | * @param ProducerInterface $producer |
||
65 | * |
||
66 | * @throws \Doctrine\ORM\NoResultException |
||
67 | * @throws \Doctrine\ORM\NonUniqueResultException |
||
68 | * |
||
69 | * @return JsonResponse |
||
70 | */ |
||
71 | 2 | public function getMovies(int $id, MovieRepository $repository, ProducerInterface $producer) |
|
85 | |||
86 | /** |
||
87 | * @Route("/api/movies/{id}/updatePoster", methods={"POST"}, requirements={"id"="\d+"}) |
||
88 | * |
||
89 | * @param Movie $movie |
||
90 | * @param UpdatePosterRequest $request |
||
91 | * |
||
92 | * @return JsonResponse |
||
93 | */ |
||
94 | 1 | public function postMoviesUpdatePoster(Movie $movie, UpdatePosterRequest $request) |
|
107 | |||
108 | /** |
||
109 | * Get movies by title. |
||
110 | * |
||
111 | * @Route("/api/movies/search", methods={"POST"}) |
||
112 | * |
||
113 | * @param SearchRequest $request |
||
114 | * @param SearchService $searchService |
||
115 | * @param Request $currentRequest |
||
116 | * |
||
117 | * @throws \Exception |
||
118 | * |
||
119 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
120 | */ |
||
121 | 2 | public function getSearch(SearchRequest $request, SearchService $searchService, Request $currentRequest) |
|
133 | |||
134 | /** |
||
135 | * Create new movie. |
||
136 | * |
||
137 | * @Route("/api/movies", methods={"POST"}) |
||
138 | * |
||
139 | * @param CreateMovieRequest $request |
||
140 | * @param MovieManageService $service |
||
141 | * @param ValidatorInterface $validator |
||
142 | * |
||
143 | * @throws \Exception |
||
144 | * |
||
145 | * @return \Symfony\Component\HttpFoundation\JsonResponse |
||
146 | */ |
||
147 | 2 | public function postMovies(CreateMovieRequest $request, MovieManageService $service, ValidatorInterface $validator) |
|
166 | |||
167 | /** |
||
168 | * @Route("/api/movies/{id}", methods={"POST", "PUT", "PATCH"}, requirements={"id"="\d+"}) |
||
169 | * |
||
170 | * @param Movie $movie |
||
171 | * @param UpdateMovieRequest $request |
||
172 | * |
||
173 | * @throws \ErrorException |
||
174 | * @throws \Exception |
||
175 | * |
||
176 | * @return JsonResponse |
||
177 | */ |
||
178 | 2 | public function putMovies(Movie $movie, UpdateMovieRequest $request) |
|
211 | } |
||
212 |
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.