|
@@ -21,12 +21,13 @@ use App\Service\CommentaireManager;
|
|
|
use App\Service\FilmManager;
|
|
|
use App\Service\OptionsManager;
|
|
|
use Symfony\Component\Form\FormFactoryInterface;
|
|
|
+use Symfony\Component\HttpFoundation\Response;
|
|
|
use Symfony\Component\Serializer\SerializerInterface;
|
|
|
|
|
|
class VideothequeController extends AbstractController
|
|
|
{
|
|
|
#[Route("/", name: "videotheque_liste")]
|
|
|
- public function listeAction(Request $request, FilmRepository $repo, OptionsManager $options)
|
|
|
+ public function listeAction(Request $request, FilmRepository $repo, OptionsManager $options): Response
|
|
|
{
|
|
|
$listeFilms = $repo->findTous();
|
|
|
|
|
@@ -37,7 +38,7 @@ class VideothequeController extends AbstractController
|
|
|
}
|
|
|
|
|
|
#[Route("/prochaines-sorties", name: "prochaines_sorties")]
|
|
|
- public function prochainesSorties(Request $request, FilmRepository $repo, OptionsManager $options)
|
|
|
+ public function prochainesSorties(Request $request, FilmRepository $repo, OptionsManager $options): Response
|
|
|
{
|
|
|
$listeFilms = $repo->findProchaines();
|
|
|
|
|
@@ -48,7 +49,7 @@ class VideothequeController extends AbstractController
|
|
|
}
|
|
|
|
|
|
#[Route("/liste-by/{id}", name: "videotheque_listepargenre")]
|
|
|
- public function listeParGenreAction(\App\Entity\Genre $genre, FilmRepository $repo, OptionsManager $options)
|
|
|
+ public function listeParGenreAction(\App\Entity\Genre $genre, FilmRepository $repo, OptionsManager $options): Response
|
|
|
{
|
|
|
$films = $repo->findFilmWithGenre(array($genre->getName()));
|
|
|
|
|
@@ -59,7 +60,7 @@ class VideothequeController extends AbstractController
|
|
|
}
|
|
|
|
|
|
#[Route("/liste-by_real/{id}", name: "videotheque_listeparreal")]
|
|
|
- public function listeParRealisateurAction(Realisateur $realisateur, FilmRepository $repo, OptionsManager $options)
|
|
|
+ public function listeParRealisateurAction(Realisateur $realisateur, FilmRepository $repo, OptionsManager $options): Response
|
|
|
{
|
|
|
$films = $repo->findFilmWithReal(array($realisateur->getNomComplet()));
|
|
|
|
|
@@ -70,7 +71,7 @@ class VideothequeController extends AbstractController
|
|
|
}
|
|
|
|
|
|
#[Route("/ajouter", name: "videotheque_ajouter")]
|
|
|
- public function ajouterAction(Request $request, FilmManager $filmManager)
|
|
|
+ public function ajouterAction(Request $request, FilmManager $filmManager): Response
|
|
|
{
|
|
|
$film = new Film;
|
|
|
$form = $this->createForm(FilmType::class, $film);
|
|
@@ -89,7 +90,7 @@ class VideothequeController extends AbstractController
|
|
|
}
|
|
|
|
|
|
#[Route("/modifier/{id}", name: "videotheque_modifier")]
|
|
|
- public function modifierAction(Request $request, Film $film, FilmManager $filmManager)
|
|
|
+ public function modifierAction(Request $request, Film $film, FilmManager $filmManager): Response
|
|
|
{
|
|
|
$form = $this->createForm(FilmType::class, $film);
|
|
|
$form->handleRequest($request);
|
|
@@ -107,7 +108,7 @@ class VideothequeController extends AbstractController
|
|
|
|
|
|
#[Route("/supprimer/{id}", name: "videotheque_supprimer")]
|
|
|
#[IsGranted("ROLE_ADMIN")]
|
|
|
- public function supprimerAction(Request $request, Film $film, FilmManager $filmManager, FormFactoryInterface $ffi)
|
|
|
+ public function supprimerAction(Request $request, Film $film, FilmManager $filmManager, FormFactoryInterface $ffi): Response
|
|
|
{
|
|
|
$form = $ffi->create();
|
|
|
$form->handleRequest($request);
|
|
@@ -125,7 +126,7 @@ class VideothequeController extends AbstractController
|
|
|
}
|
|
|
|
|
|
#[Route("/fichefilm/{id}", name: "videotheque_voirfilm")]
|
|
|
- public function voirFilmAction(Request $request, \App\Entity\Film $film, CommentaireManager $cm, Security $security, CommentaireRepository $repo)
|
|
|
+ public function voirFilmAction(Request $request, \App\Entity\Film $film, CommentaireManager $cm, Security $security, CommentaireRepository $repo): Response
|
|
|
{
|
|
|
if ($security->isGranted('IS_AUTHENTICATED_REMEMBERED'))
|
|
|
{
|
|
@@ -153,7 +154,7 @@ class VideothequeController extends AbstractController
|
|
|
}
|
|
|
|
|
|
#[Route("/ajax_req_realisateurs", name: "videotheque_ajax_realisateurs")]
|
|
|
- public function ajaxRealisateurs(RealisateurRepository $repo, SerializerInterface $serializer)
|
|
|
+ public function ajaxRealisateurs(RealisateurRepository $repo, SerializerInterface $serializer): Response
|
|
|
{
|
|
|
$realisateurs = $repo->findNomsComplets();
|
|
|
$liste = array();
|
|
@@ -166,7 +167,7 @@ class VideothequeController extends AbstractController
|
|
|
}
|
|
|
|
|
|
#[Route("/ajax_req_genres", name: "videotheque_ajax_genres")]
|
|
|
- public function ajaxGenres(GenreRepository $repo, SerializerInterface $serializer)
|
|
|
+ public function ajaxGenres(GenreRepository $repo, SerializerInterface $serializer): Response
|
|
|
{
|
|
|
$genres = $repo->findGenres();
|
|
|
$liste = array();
|