Skip to content

Commit

Permalink
Create a BaseController
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayvented committed Dec 4, 2023
1 parent 9e28437 commit 408950f
Show file tree
Hide file tree
Showing 37 changed files with 45 additions and 72 deletions.
3 changes: 1 addition & 2 deletions src/Controller/AkademieController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
use Doctrine\ORM\EntityManagerInterface;
use Nucleos\DompdfBundle\Wrapper\DompdfWrapper;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;

#[Route(path: '/akademie', name: 'akademie')]
class AkademieController extends AbstractController
class AkademieController extends BaseController
{


Expand Down
3 changes: 1 addition & 2 deletions src/Controller/AssignController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
use App\Service\AssignService;
use App\Service\CurrentTeamService;
use App\Service\SecurityService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

#[Route(path: '/assign', name: 'assign')]
class AssignController extends AbstractController
class AssignController extends BaseController
{
#[Route(path: '/audit', name: '_audit')]
public function assignAudit(
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/AssistantController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use App\Service\AssistantService;
use App\Service\SecurityService;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -19,7 +18,7 @@
use Symfony\Contracts\Translation\TranslatorInterface;

#[Route(path: '/assistant', name: 'assistant')]
class AssistantController extends AbstractController
class AssistantController extends BaseController
{
#[Route('', name: '')]
public function index(SecurityService $securityService,
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/AuditTomController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
use DateTime;
use Doctrine\ORM\EntityManagerInterface;
use Exception;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

#[Route(path: '/audit-tom', name: 'audit_tom')]
class AuditTomController extends AbstractController
class AuditTomController extends BaseController
{


Expand Down
9 changes: 9 additions & 0 deletions src/Controller/BaseController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class BaseController extends AbstractController
{
}
3 changes: 1 addition & 2 deletions src/Controller/BerichtController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
use Nucleos\DompdfBundle\Wrapper\DompdfWrapper;
use PhpOffice\PhpWord\IOFactory;
use PhpOffice\PhpWord\PhpWord;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -40,7 +39,7 @@
use Symfony\Contracts\Translation\TranslatorInterface;

#[Route(path: '/bericht', name: 'bericht')]
class BerichtController extends AbstractController
class BerichtController extends BaseController
{
public function __construct(
private readonly TranslatorInterface $translator,
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/ClientRequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
use Doctrine\ORM\EntityManagerInterface;
use Exception;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class ClientRequestController extends AbstractController
class ClientRequestController extends BaseController
{


Expand Down
3 changes: 1 addition & 2 deletions src/Controller/CronController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
use App\Service\NotificationService;
use DateTime;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;

class CronController extends AbstractController
class CronController extends BaseController
{
#[Route(path: '/cron/akademie_update', name: 'cron_akademie')]
public function updateCronAkademie(NotificationService $notificationService, Request $request, LoggerInterface $logger)
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
use App\Repository\VVTRepository;
use App\Service\CurrentTeamService;
use App\Service\SecurityService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class DashboardController extends AbstractController
class DashboardController extends BaseController
{
#[Route(path: '/', name: 'dashboard')]
public function dashboard(Request $request,
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/DatenweitergabeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
use League\Flysystem\FilesystemOperator;
use Psr\Log\LoggerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\HeaderUtils;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class DatenweitergabeController extends AbstractController
class DatenweitergabeController extends BaseController
{
public function __construct(
private readonly TranslatorInterface $translator,
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/DsbController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
use App\Repository\TeamRepository;
use App\Service\CurrentTeamService;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;

class DsbController extends AbstractController
class DsbController extends BaseController
{


Expand Down
3 changes: 1 addition & 2 deletions src/Controller/ExternalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

use App\Service\CurrentTeamService;
use App\Service\SecurityService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class ExternalController extends AbstractController
class ExternalController extends BaseController
{
#[Route(path: '/external', name: 'external')]
public function index(
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/FirstRunController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
namespace App\Controller;

use App\Repository\TeamRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class FirstRunController extends AbstractController
class FirstRunController extends BaseController
{
#[Route(path: '/first/run', name: 'first_run')]
public function index(TeamRepository $teamRepository): Response
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/FormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
use League\Flysystem\FilesystemOperator;
use Psr\Log\LoggerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\HeaderUtils;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class FormsController extends AbstractController
class FormsController extends BaseController
{


Expand Down
3 changes: 1 addition & 2 deletions src/Controller/HealthCheckController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@

use App\Repository\VorfallRepository;
use Exception;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class HealthCheckController extends AbstractController
class HealthCheckController extends BaseController
{
#[Route(path: '/health/check', name: 'health_check', methods: ['GET'])]
public function index(VorfallRepository $incidentRepository): Response
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/InvitationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
use App\Entity\User;
use App\Service\InviteService;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class InvitationController extends AbstractController
class InvitationController extends BaseController
{
#[Route(path: '/login/invitationAccept/{id}', name: 'invitation_accept')]
#[ParamConverter('user', class: 'App\Entity\User', options: ['mapping' => ['id' => 'registerId']])]
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/KontaktController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
use App\Service\DisableService;
use App\Service\SecurityService;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class KontaktController extends AbstractController
class KontaktController extends BaseController
{


Expand Down
3 changes: 1 addition & 2 deletions src/Controller/KursController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
use App\Service\SecurityService;
use DateTime;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class KursController extends AbstractController
class KursController extends BaseController
{


Expand Down
3 changes: 1 addition & 2 deletions src/Controller/LoeschkonzeptController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
use App\Service\LoeschkonzeptService;
use App\Service\SecurityService;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

#[Route(path: '/loeschkonzept')]
class LoeschkonzeptController extends AbstractController
class LoeschkonzeptController extends BaseController
{
#[Route(path: '/{id}/delete', name: 'app_loeschkonzept_delete', methods: ['POST'])]
public function delete(
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
use KnpU\OAuth2ClientBundle\Client\Provider\Auth0Client;
use Stevenmaguire\OAuth2\Client\Provider\Keycloak;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGenerator;

class LoginController extends AbstractController
class LoginController extends BaseController
{
#[Route(path: '/login/auth0_login/check', name: 'connect_auth0_check')]
public function check(
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/LoginControllerKeycloak.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
namespace App\Controller;

use KnpU\OAuth2ClientBundle\Client\ClientRegistry;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class LoginControllerKeycloak extends AbstractController
class LoginControllerKeycloak extends BaseController
{
public function check(ClientRegistry $clientRegistry, Request $request)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/ParticipationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
use App\Service\CurrentTeamService;
use Doctrine\ORM\EntityManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\User\UserInterface;

#[Route(path: '/participation', name: 'participation')]
class ParticipationController extends AbstractController
class ParticipationController extends BaseController
{
private static string $TEMPLATE_DIR = 'questionnaire/participation/';

Expand Down
3 changes: 1 addition & 2 deletions src/Controller/ParticipationQuestionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
use App\Repository\QuestionRepository;
use Doctrine\ORM\EntityManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

#[Route(path: 'participation-question/{id}', name: 'participation_question')]
#[ParamConverter(data: 'participation', class: Participation::class, options: ['mapping' => ['id' => 'id']])]
class ParticipationQuestionController extends AbstractController
class ParticipationQuestionController extends BaseController
{
private static string $TEMPLATE_DIR = 'questionnaire/participationQuestion/';

Expand Down
3 changes: 1 addition & 2 deletions src/Controller/PoliciesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
use League\Flysystem\FilesystemOperator;
use Psr\Log\LoggerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\HeaderUtils;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

class PoliciesController extends AbstractController
class PoliciesController extends BaseController
{


Expand Down
3 changes: 1 addition & 2 deletions src/Controller/QuestionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
use App\Repository\QuestionnaireQuestionRepository;
use Doctrine\ORM\EntityManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

#[Route(path: '/questionnaire/question', name: 'question')]
class QuestionController extends AbstractController
class QuestionController extends BaseController
{
private static string $TEMPLATE_DIR = 'questionnaire/question/';

Expand Down
3 changes: 1 addition & 2 deletions src/Controller/QuestionnaireController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use App\Service\CurrentTeamService;
use Doctrine\ORM\EntityManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -22,7 +21,7 @@
use Symfony\Component\Security\Core\User\UserInterface;

#[Route(path: '/questionnaire', name: 'questionnaire')]
class QuestionnaireController extends AbstractController
class QuestionnaireController extends BaseController
{
private static string $TEMPLATE_DIR = 'questionnaire/questionnaire/';

Expand Down
Loading

0 comments on commit 408950f

Please sign in to comment.