From f9ab0246338b5575081a9a78f4562306e056c1a6 Mon Sep 17 00:00:00 2001 From: Jeroen Thora Date: Wed, 20 Dec 2023 23:21:13 +0100 Subject: [PATCH] [AllBundles] Switch Route and Validator annotations to attributes --- .../ForcedChangePasswordController.php | 8 +- .../PasswordResetController.php | 8 +- .../Authentication/SecurityController.php | 8 +- .../Controller/DefaultController.php | 6 +- .../Controller/ExceptionController.php | 18 +-- .../Controller/ModulesController.php | 4 +- .../Controller/SettingsController.php | 17 +-- .../AdminBundle/Entity/Exception.php | 2 +- src/Kunstmaan/AdminBundle/Entity/Group.php | 6 +- src/Kunstmaan/AdminBundle/Entity/Role.php | 3 +- .../Controller/EntityLockCheckController.php | 7 +- .../ArticleBundle/Entity/AbstractCategory.php | 6 +- .../ArticleBundle/Entity/AbstractTag.php | 6 +- .../Controller/VarnishController.php | 6 +- .../Controller/CookieAdminListController.php | 18 +-- .../Controller/CookieMenuController.php | 3 +- .../CookieTypeAdminListController.php | 24 +-- .../Controller/LegalController.php | 10 +- src/Kunstmaan/CookieBundle/Entity/Cookie.php | 6 +- .../CookieBundle/Entity/CookieType.php | 32 +--- .../Controller/DashboardController.php | 3 +- .../GoogleAnalyticsAJAXController.php | 60 ++------ .../Controller/GoogleAnalyticsController.php | 28 +--- .../Controller/FormSubmissionsController.php | 22 +-- .../FormBundle/Entity/AbstractFormPage.php | 4 +- .../FileFormSubmissionField.php | 3 +- .../StringFormSubmissionField.php | 2 +- .../Entity/PageParts/AbstractFormPagePart.php | 6 +- .../Entity/PageParts/CheckboxPagePart.php | 2 +- .../Entity/PageParts/ChoicePagePart.php | 4 +- .../Entity/PageParts/EmailPagePart.php | 4 +- .../Entity/PageParts/FileUploadPagePart.php | 2 +- .../PageParts/MultiLineTextPagePart.php | 6 +- .../PageParts/SingleLineTextPagePart.php | 6 +- .../Entity/PageParts/SubmitButtonPagePart.php | 2 +- .../AbstractNewsletterController.php | 7 +- .../Controller/AbstractRedirectController.php | 4 +- .../Controller/PopupsAdminListController.php | 27 ++-- .../Controller/RulesAdminListController.php | 28 +--- .../Entity/Popup/AbstractPopup.php | 6 +- .../Entity/Rule/AfterXScrollPercentRule.php | 4 +- .../Entity/Rule/AfterXSecondsRule.php | 4 +- .../Entity/Rule/LocaleBlacklistRule.php | 2 +- .../Entity/Rule/LocaleWhitelistRule.php | 2 +- .../Entity/Rule/MaxXTimesRule.php | 4 +- .../Entity/Rule/OnExitIntentRule.php | 6 +- .../Entity/Rule/RecurringEveryXTimeRule.php | 10 +- .../Entity/Rule/UrlBlacklistRule.php | 2 +- .../Entity/Rule/UrlWhitelistRule.php | 2 +- .../Controller/ChooserController.php | 7 +- .../Controller/FolderController.php | 15 +- .../Controller/IconFontController.php | 4 +- .../Controller/MediaController.php | 24 +-- .../Entity/EditableMediaWrapper.php | 2 +- src/Kunstmaan/MediaBundle/Entity/Folder.php | 2 +- .../Controller/MenuAdminListController.php | 6 +- .../MenuItemAdminListController.php | 36 ++--- src/Kunstmaan/MenuBundle/Entity/BaseMenu.php | 8 +- .../MenuBundle/Entity/BaseMenuItem.php | 14 +- .../Controller/SiteSwitchController.php | 7 +- .../Controller/NodeAdminController.php | 144 ++---------------- .../Controller/UrlReplaceController.php | 3 +- .../Controller/WidgetsController.php | 19 +-- .../Entity/AbstractControllerAction.php | 9 +- .../NodeBundle/Entity/AbstractPage.php | 14 +- src/Kunstmaan/NodeBundle/Entity/Node.php | 2 +- .../NodeBundle/Entity/NodeTranslation.php | 8 +- .../Controller/PagePartAdminController.php | 4 +- .../RedirectAdminListController.php | 25 +-- .../RedirectBundle/Entity/Redirect.php | 9 +- .../Controller/Admin/SettingsController.php | 3 +- .../SeoBundle/Controller/RobotsController.php | 3 +- .../Controller/SitemapController.php | 6 +- .../Controller/TagAdminListController.php | 20 +-- src/Kunstmaan/TaggingBundle/Entity/Tag.php | 1 - .../TranslatorCommandController.php | 12 +- .../Controller/TranslatorController.php | 31 +--- .../TranslatorBundle/Entity/Translation.php | 12 +- .../TranslatorBundle/Model/TextWithLocale.php | 3 +- .../TranslatorBundle/Model/Translation.php | 10 +- .../Controller/GroupsController.php | 23 +-- .../Controller/RolesController.php | 23 +-- .../Controller/UsersController.php | 18 +-- .../Controller/VotingController.php | 20 +-- 84 files changed, 258 insertions(+), 749 deletions(-) diff --git a/src/Kunstmaan/AdminBundle/Controller/Authentication/ForcedChangePasswordController.php b/src/Kunstmaan/AdminBundle/Controller/Authentication/ForcedChangePasswordController.php index ce057ff06b..c65c1602fd 100644 --- a/src/Kunstmaan/AdminBundle/Controller/Authentication/ForcedChangePasswordController.php +++ b/src/Kunstmaan/AdminBundle/Controller/Authentication/ForcedChangePasswordController.php @@ -21,9 +21,7 @@ public function __construct(UserManager $userManager) $this->userManager = $userManager; } - /** - * @Route("/change-password", name="kunstmaan_admin_forced_change_password", methods={"GET", "POST"}) - */ + #[Route(path: '/change-password', name: 'kunstmaan_admin_forced_change_password', methods: ['GET', 'POST'])] public function formAction(Request $request): Response { $user = $this->getUser(); @@ -45,9 +43,7 @@ public function formAction(Request $request): Response ]); } - /** - * @Route("/change-password/success", name="kunstmaan_admin_forced_change_password_success", methods={"GET"}) - */ + #[Route(path: '/change-password/success', name: 'kunstmaan_admin_forced_change_password_success', methods: ['GET'])] public function successAction(): Response { return $this->render('@KunstmaanAdmin/authentication/forced_change_password/success.html.twig', [ diff --git a/src/Kunstmaan/AdminBundle/Controller/Authentication/PasswordResetController.php b/src/Kunstmaan/AdminBundle/Controller/Authentication/PasswordResetController.php index b5e2809e62..184c2e5858 100644 --- a/src/Kunstmaan/AdminBundle/Controller/Authentication/PasswordResetController.php +++ b/src/Kunstmaan/AdminBundle/Controller/Authentication/PasswordResetController.php @@ -26,9 +26,7 @@ public function __construct(PasswordResetService $passwordResetService, UserMana $this->userManager = $userManager; } - /** - * @Route("/password-reset/request", name="kunstmaan_admin_reset_password", methods={"GET", "POST"}) - */ + #[Route(path: '/password-reset/request', name: 'kunstmaan_admin_reset_password', methods: ['GET', 'POST'])] public function requestAction(Request $request) { $form = $this->createForm(PasswordRequestType::class); @@ -49,9 +47,7 @@ public function requestAction(Request $request) return $this->render('@KunstmaanAdmin/authentication/password_reset/request.html.twig', ['form' => $form->createView()]); } - /** - * @Route("/password-reset/confirm/{token}", name="kunstmaan_admin_reset_password_confirm", methods={"GET", "POST"}) - */ + #[Route(path: '/password-reset/confirm/{token}', name: 'kunstmaan_admin_reset_password_confirm', methods: ['GET', 'POST'])] public function confirmAction(Request $request, string $token) { /** @var UserInterface|null $user */ diff --git a/src/Kunstmaan/AdminBundle/Controller/Authentication/SecurityController.php b/src/Kunstmaan/AdminBundle/Controller/Authentication/SecurityController.php index 31565e8f7b..9ccbcace53 100644 --- a/src/Kunstmaan/AdminBundle/Controller/Authentication/SecurityController.php +++ b/src/Kunstmaan/AdminBundle/Controller/Authentication/SecurityController.php @@ -20,9 +20,7 @@ public function __construct(AuthenticationUtils $authenticationUtils, Environmen $this->twig = $twig; } - /** - * @Route("/login", name="kunstmaan_admin_login", methods={"GET", "POST"}) - */ + #[Route(path: '/login', name: 'kunstmaan_admin_login', methods: ['GET', 'POST'])] public function loginAction() { $error = $this->authenticationUtils->getLastAuthenticationError(); @@ -34,9 +32,7 @@ public function loginAction() ])); } - /** - * @Route("/logout", name="kunstmaan_admin_logout") - */ + #[Route(path: '/logout', name: 'kunstmaan_admin_logout')] public function logoutAction() { throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.'); diff --git a/src/Kunstmaan/AdminBundle/Controller/DefaultController.php b/src/Kunstmaan/AdminBundle/Controller/DefaultController.php index 40e398a976..09a3e3fc8e 100644 --- a/src/Kunstmaan/AdminBundle/Controller/DefaultController.php +++ b/src/Kunstmaan/AdminBundle/Controller/DefaultController.php @@ -36,9 +36,8 @@ public function __construct(ParameterBagInterface $parameterBag, ManagerRegistry /** * The index action will render the main screen the users see when they log in in to the admin - * - * @Route("/", name="KunstmaanAdminBundle_homepage") */ + #[Route(path: '/', name: 'KunstmaanAdminBundle_homepage')] public function indexAction(): Response { if ($this->parameterBag->has('kunstmaan_admin.dashboard_route')) { @@ -56,9 +55,8 @@ public function indexAction(): Response /** * The admin of the index page - * - * @Route("/adminindex", name="KunstmaanAdminBundle_homepage_admin") */ + #[Route(path: '/adminindex', name: 'KunstmaanAdminBundle_homepage_admin')] public function editIndexAction(Request $request): Response { /* @var $em EntityManager */ diff --git a/src/Kunstmaan/AdminBundle/Controller/ExceptionController.php b/src/Kunstmaan/AdminBundle/Controller/ExceptionController.php index 881b3966ba..b5e058073b 100644 --- a/src/Kunstmaan/AdminBundle/Controller/ExceptionController.php +++ b/src/Kunstmaan/AdminBundle/Controller/ExceptionController.php @@ -24,23 +24,16 @@ private function getAdminListConfigurator() return $this->configurator; } - /** - * @Route("/", name="kunstmaanadminbundle_admin_exception") - */ + #[Route(path: '/', name: 'kunstmaanadminbundle_admin_exception')] public function indexAction(Request $request) { return parent::doIndexAction($this->getAdminListConfigurator(), $request); } /** - * @Route("/resolve_all", name="kunstmaanadminbundle_admin_exception_resolve_all", methods={"POST"}) - * * @return RedirectResponse - * - * @throws \Doctrine\ORM\NonUniqueResultException - * @throws \Doctrine\ORM\NoResultException - * @throws \InvalidArgumentException */ + #[Route(path: '/resolve_all', name: 'kunstmaanadminbundle_admin_exception_resolve_all', methods: ['POST'])] public function resolveAllAction(Request $request) { if (!$this->isCsrfTokenValid('exception-resolve_all', $request->request->get('token'))) { @@ -60,14 +53,9 @@ public function resolveAllAction(Request $request) } /** - * @Route("/toggle_resolve/{id}", name="kunstmaanadminbundle_admin_exception_toggle_resolve", methods={"POST"}) - * * @return RedirectResponse - * - * @throws \Doctrine\ORM\OptimisticLockException - * @throws \InvalidArgumentException - * @throws \Doctrine\ORM\ORMInvalidArgumentException */ + #[Route(path: '/toggle_resolve/{id}', name: 'kunstmaanadminbundle_admin_exception_toggle_resolve', methods: ['POST'])] public function toggleResolveAction(Request $request, Exception $model) { if (!$this->isCsrfTokenValid('exception-resolve-item', $request->request->get('token'))) { diff --git a/src/Kunstmaan/AdminBundle/Controller/ModulesController.php b/src/Kunstmaan/AdminBundle/Controller/ModulesController.php index d03d3b145e..9a7e27397c 100644 --- a/src/Kunstmaan/AdminBundle/Controller/ModulesController.php +++ b/src/Kunstmaan/AdminBundle/Controller/ModulesController.php @@ -8,9 +8,7 @@ final class ModulesController extends AbstractController { - /** - * @Route("/", name="KunstmaanAdminBundle_modules") - */ + #[Route(path: '/', name: 'KunstmaanAdminBundle_modules')] public function indexAction(): Response { return $this->render('@KunstmaanAdmin/Modules/index.html.twig'); diff --git a/src/Kunstmaan/AdminBundle/Controller/SettingsController.php b/src/Kunstmaan/AdminBundle/Controller/SettingsController.php index 89739e04cc..2e51d1c69a 100644 --- a/src/Kunstmaan/AdminBundle/Controller/SettingsController.php +++ b/src/Kunstmaan/AdminBundle/Controller/SettingsController.php @@ -7,7 +7,6 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; final class SettingsController extends AbstractController { @@ -22,13 +21,7 @@ public function __construct(VersionChecker $versionChecker, LoggerInterface $log $this->logger = $logger; } - /** - * Index page for the settings - * - * @Route("/", name="KunstmaanAdminBundle_settings") - * - * @throws AccessDeniedException - */ + #[Route(path: '/', name: 'KunstmaanAdminBundle_settings')] public function indexAction(): Response { $this->denyAccessUnlessGranted('ROLE_ADMIN'); @@ -36,13 +29,7 @@ public function indexAction(): Response return $this->render('@KunstmaanAdmin/Settings/index.html.twig'); } - /** - * Show bundles version update information - * - * @Route("/bundle-version", name="KunstmaanAdminBundle_settings_bundle_version") - * - * @throws AccessDeniedException - */ + #[Route(path: '/bundle-version', name: 'KunstmaanAdminBundle_settings_bundle_version')] public function bundleVersionAction(): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); diff --git a/src/Kunstmaan/AdminBundle/Entity/Exception.php b/src/Kunstmaan/AdminBundle/Entity/Exception.php index ba76ec5c7f..c2c9d23a1a 100644 --- a/src/Kunstmaan/AdminBundle/Entity/Exception.php +++ b/src/Kunstmaan/AdminBundle/Entity/Exception.php @@ -14,7 +14,6 @@ * @ORM\Index(name="idx_exception_is_resolved", columns={"is_resolved"}) * } * ) - * @UniqueEntity("hash") * @ORM\HasLifecycleCallbacks() */ #[ORM\Entity(repositoryClass: ExceptionRepository::class)] @@ -22,6 +21,7 @@ #[ORM\Index(name: 'idx_exception_is_resolved', columns: ['is_resolved'])] #[UniqueEntity('hash')] #[ORM\HasLifecycleCallbacks] +#[UniqueEntity('hash')] class Exception extends AbstractEntity { /** diff --git a/src/Kunstmaan/AdminBundle/Entity/Group.php b/src/Kunstmaan/AdminBundle/Entity/Group.php index 844173ec3e..ff31692c04 100644 --- a/src/Kunstmaan/AdminBundle/Entity/Group.php +++ b/src/Kunstmaan/AdminBundle/Entity/Group.php @@ -27,10 +27,10 @@ class Group implements GroupInterface protected $id; /** - * @Assert\NotBlank() * @ORM\Column(type="string") */ #[ORM\Column(name: 'name', type: 'string')] + #[Assert\NotBlank] protected $name; /** @@ -226,9 +226,7 @@ public function setName($name) return $this; } - /** - * @Assert\Callback() - */ + #[Assert\Callback] public function isGroupValid(ExecutionContextInterface $context) { if (!(\count($this->getRoles()) > 0)) { diff --git a/src/Kunstmaan/AdminBundle/Entity/Role.php b/src/Kunstmaan/AdminBundle/Entity/Role.php index 96a2133ce3..f051cf1fb5 100644 --- a/src/Kunstmaan/AdminBundle/Entity/Role.php +++ b/src/Kunstmaan/AdminBundle/Entity/Role.php @@ -9,7 +9,6 @@ /** * @ORM\Entity * @ORM\Table( name="kuma_roles" ) - * @UniqueEntity("role") */ #[ORM\Entity] #[ORM\Table(name: 'kuma_roles')] @@ -27,10 +26,10 @@ class Role protected $id; /** - * @Assert\NotBlank() * @ORM\Column(type="string", name="role", unique=true, length=70) */ #[ORM\Column(name: 'role', type: 'string', unique: true, length: 70)] + #[Assert\NotBlank] protected $role; /** diff --git a/src/Kunstmaan/AdminListBundle/Controller/EntityLockCheckController.php b/src/Kunstmaan/AdminListBundle/Controller/EntityLockCheckController.php index dca221f7e3..1cf3105b7b 100644 --- a/src/Kunstmaan/AdminListBundle/Controller/EntityLockCheckController.php +++ b/src/Kunstmaan/AdminListBundle/Controller/EntityLockCheckController.php @@ -33,14 +33,9 @@ protected function getEntityManager() } /** - * @Route( - * "check/{id}/{repository}", - * requirements={"id" = "\d+"}, - * name="KunstmaanAdminListBundle_entity_lock_check" - * ) - * * @return JsonResponse */ + #[Route(path: 'check/{id}/{repository}', requirements: ['id' => '\d+'], name: 'KunstmaanAdminListBundle_entity_lock_check')] public function checkAction(Request $request, $id, $repository) { $entityIsLocked = false; diff --git a/src/Kunstmaan/ArticleBundle/Entity/AbstractCategory.php b/src/Kunstmaan/ArticleBundle/Entity/AbstractCategory.php index 3814f00695..2893bcdeb1 100644 --- a/src/Kunstmaan/ArticleBundle/Entity/AbstractCategory.php +++ b/src/Kunstmaan/ArticleBundle/Entity/AbstractCategory.php @@ -14,11 +14,11 @@ abstract class AbstractCategory extends AbstractEntity implements Translatable * @var string * * @ORM\Column(name="name", type="string", length=255) - * @Assert\NotBlank() * @Gedmo\Translatable */ #[ORM\Column(name: 'name', type: 'string', length: 255)] #[Gedmo\Translatable] + #[Assert\NotBlank] protected $name; /** @@ -36,8 +36,6 @@ abstract class AbstractCategory extends AbstractEntity implements Translatable protected $deletedAt; /** - * Set name - * * @param string $name */ public function setName($name) @@ -46,8 +44,6 @@ public function setName($name) } /** - * Get name - * * @return string */ public function getName() diff --git a/src/Kunstmaan/ArticleBundle/Entity/AbstractTag.php b/src/Kunstmaan/ArticleBundle/Entity/AbstractTag.php index e0160d2c64..8501379372 100644 --- a/src/Kunstmaan/ArticleBundle/Entity/AbstractTag.php +++ b/src/Kunstmaan/ArticleBundle/Entity/AbstractTag.php @@ -14,11 +14,11 @@ abstract class AbstractTag extends AbstractEntity implements Translatable * @var string * * @ORM\Column(name="name", type="string", length=255) - * @Assert\NotBlank() * @Gedmo\Translatable */ #[ORM\Column(name: 'name', type: 'string', length: 255)] #[Gedmo\Translatable] + #[Assert\NotBlank] protected $name; /** @@ -36,8 +36,6 @@ abstract class AbstractTag extends AbstractEntity implements Translatable protected $deletedAt; /** - * Set name - * * @param string $name */ public function setName($name) @@ -46,8 +44,6 @@ public function setName($name) } /** - * Get name - * * @return string */ public function getName() diff --git a/src/Kunstmaan/CacheBundle/Controller/VarnishController.php b/src/Kunstmaan/CacheBundle/Controller/VarnishController.php index d0f34d2b4f..48971fab56 100644 --- a/src/Kunstmaan/CacheBundle/Controller/VarnishController.php +++ b/src/Kunstmaan/CacheBundle/Controller/VarnishController.php @@ -25,9 +25,8 @@ public function __construct(VarnishHelper $varnishHelper) /** * Generates the varnish ban form. - * - * @Route("/settings/varnish", name="kunstmaancachebundle_varnish_settings_ban") */ + #[Route(path: '/settings/varnish', name: 'kunstmaancachebundle_varnish_settings_ban')] public function indexAction(Request $request): Response { $this->checkPermission(); @@ -54,10 +53,9 @@ public function indexAction(Request $request): Response /** * Ban route from varnish * - * @Route("/varnish/ban/{node}", name="kunstmaancachebundle_varnish_ban") - * * @return RedirectResponse */ + #[Route(path: '/varnish/ban/{node}', name: 'kunstmaancachebundle_varnish_ban')] public function banAction(Node $node) { $this->checkPermission(); diff --git a/src/Kunstmaan/CookieBundle/Controller/CookieAdminListController.php b/src/Kunstmaan/CookieBundle/Controller/CookieAdminListController.php index 8195718fdb..d3f5b409dd 100644 --- a/src/Kunstmaan/CookieBundle/Controller/CookieAdminListController.php +++ b/src/Kunstmaan/CookieBundle/Controller/CookieAdminListController.php @@ -36,68 +36,62 @@ public function getAdminListConfigurator() } /** - * @Route("/", name="kunstmaancookiebundle_admin_cookie") - * * @return Response */ + #[Route(path: '/', name: 'kunstmaancookiebundle_admin_cookie')] public function indexAction(Request $request) { return parent::doIndexAction($this->getAdminListConfigurator(), $request); } /** - * @Route("/add", name="kunstmaancookiebundle_admin_cookie_add", methods={"GET", "POST"}) - * * @return Response */ + #[Route(path: '/add', name: 'kunstmaancookiebundle_admin_cookie_add', methods: ['GET', 'POST'])] public function addAction(Request $request) { return parent::doAddAction($this->getAdminListConfigurator(), null, $request); } /** - * @Route("/{id}", requirements={"id" = "\d+"}, name="kunstmaancookiebundle_admin_cookie_edit", methods={"GET", "POST"}) - * * @param int $id * * @return Response */ + #[Route(path: '/{id}', requirements: ['id' => '\d+'], name: 'kunstmaancookiebundle_admin_cookie_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id) { return parent::doEditAction($this->getAdminListConfigurator(), $id, $request); } /** - * @Route("/{id}/view", requirements={"id" = "\d+"}, name="kunstmaancookiebundle_admin_cookie_view", methods={"GET"}) - * * @param int $id * * @return Response */ + #[Route(path: '/{id}/view', requirements: ['id' => '\d+'], name: 'kunstmaancookiebundle_admin_cookie_view', methods: ['GET'])] public function viewAction(Request $request, $id) { return parent::doViewAction($this->getAdminListConfigurator(), $id, $request); } /** - * @Route("/{id}/delete", requirements={"id" = "\d+"}, name="kunstmaancookiebundle_admin_cookie_delete", methods={"GET", "POST"}) - * * @param int $id * * @return Response */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'kunstmaancookiebundle_admin_cookie_delete', methods: ['GET', 'POST'])] public function deleteAction(Request $request, $id) { return parent::doDeleteAction($this->getAdminListConfigurator(), $id, $request); } /** - * @Route("/export.{_format}", requirements={"_format" = "csv|ods|xlsx"}, name="kunstmaancookiebundle_admin_cookie_export", methods={"GET", "POST"}) - * * @param string $_format * * @return Response */ + #[Route(path: '/export.{_format}', requirements: ['_format' => 'csv|ods|xlsx'], name: 'kunstmaancookiebundle_admin_cookie_export', methods: ['GET', 'POST'])] public function exportAction(Request $request, $_format) { return parent::doExportAction($this->getAdminListConfigurator(), $_format, $request); diff --git a/src/Kunstmaan/CookieBundle/Controller/CookieMenuController.php b/src/Kunstmaan/CookieBundle/Controller/CookieMenuController.php index e73ec86511..b2dd3f3057 100644 --- a/src/Kunstmaan/CookieBundle/Controller/CookieMenuController.php +++ b/src/Kunstmaan/CookieBundle/Controller/CookieMenuController.php @@ -9,10 +9,9 @@ final class CookieMenuController extends AbstractController { /** - * @Route("/", name="kunstmaancookiebundle_admin_cookies") - * * @return RedirectResponse */ + #[Route(path: '/', name: 'kunstmaancookiebundle_admin_cookies')] public function cookiesAction() { return $this->redirectToRoute('kunstmaancookiebundle_admin_cookietype'); diff --git a/src/Kunstmaan/CookieBundle/Controller/CookieTypeAdminListController.php b/src/Kunstmaan/CookieBundle/Controller/CookieTypeAdminListController.php index 8ff1fe3727..5d3865fd74 100644 --- a/src/Kunstmaan/CookieBundle/Controller/CookieTypeAdminListController.php +++ b/src/Kunstmaan/CookieBundle/Controller/CookieTypeAdminListController.php @@ -31,92 +31,84 @@ public function getAdminListConfigurator() } /** - * @Route("/", name="kunstmaancookiebundle_admin_cookietype") - * * @return Response */ + #[Route(path: '/', name: 'kunstmaancookiebundle_admin_cookietype')] public function indexAction(Request $request) { return parent::doIndexAction($this->getAdminListConfigurator(), $request); } /** - * @Route("/add", name="kunstmaancookiebundle_admin_cookietype_add", methods={"GET", "POST"}) - * * @return Response */ + #[Route(path: '/add', name: 'kunstmaancookiebundle_admin_cookietype_add', methods: ['GET', 'POST'])] public function addAction(Request $request) { return parent::doAddAction($this->getAdminListConfigurator(), null, $request); } /** - * @Route("/{id}", requirements={"id" = "\d+"}, name="kunstmaancookiebundle_admin_cookietype_edit", methods={"GET", "POST"}) - * * @param int $id * * @return Response */ + #[Route(path: '/{id}', requirements: ['id' => '\d+'], name: 'kunstmaancookiebundle_admin_cookietype_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id) { return parent::doEditAction($this->getAdminListConfigurator(), $id, $request); } /** - * @Route("/{id}/view", requirements={"id" = "\d+"}, name="kunstmaancookiebundle_admin_cookietype_view", methods={"GET"}) - * * @param int $id * * @return Response */ + #[Route(path: '/{id}/view', requirements: ['id' => '\d+'], name: 'kunstmaancookiebundle_admin_cookietype_view', methods: ['GET'])] public function viewAction(Request $request, $id) { return parent::doViewAction($this->getAdminListConfigurator(), $id, $request); } /** - * @Route("/{id}/delete", requirements={"id" = "\d+"}, name="kunstmaancookiebundle_admin_cookietype_delete", methods={"GET"}) - * * @param int $id * * @return Response */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'kunstmaancookiebundle_admin_cookietype_delete', methods: ['GET'])] public function deleteAction(Request $request, $id) { return parent::doDeleteAction($this->getAdminListConfigurator(), $id, $request); } /** - * @Route("/export.{_format}", requirements={"_format" = "csv|ods|xlsx"}, name="kunstmaancookiebundle_admin_cookietype_export", methods={"GET", "POST"}) - * * @param string $_format * * @return Response */ + #[Route(path: '/export.{_format}', requirements: ['_format' => 'csv|ods|xlsx'], name: 'kunstmaancookiebundle_admin_cookietype_export', methods: ['GET', 'POST'])] public function exportAction(Request $request, $_format) { return parent::doExportAction($this->getAdminListConfigurator(), $_format, $request); } /** - * @Route("/{id}/move-up", requirements={"id" = "\d+"}, name="kunstmaancookiebundle_admin_cookietype_move_up", methods={"GET"}) - * * @param int $id * * @return RedirectResponse */ + #[Route(path: '/{id}/move-up', requirements: ['id' => '\d+'], name: 'kunstmaancookiebundle_admin_cookietype_move_up', methods: ['GET'])] public function moveUpAction(Request $request, $id) { return parent::doMoveUpAction($this->getAdminListConfigurator(), $id, $request); } /** - * @Route("/{id}/move-down", requirements={"id" = "\d+"}, name="kunstmaancookiebundle_admin_cookietype_move_down", methods={"GET"}) - * * @param int $id * * @return RedirectResponse */ + #[Route(path: '/{id}/move-down', requirements: ['id' => '\d+'], name: 'kunstmaancookiebundle_admin_cookietype_move_down', methods: ['GET'])] public function moveDownAction(Request $request, $id) { return parent::doMoveDownAction($this->getAdminListConfigurator(), $id, $request); diff --git a/src/Kunstmaan/CookieBundle/Controller/LegalController.php b/src/Kunstmaan/CookieBundle/Controller/LegalController.php index 1dfb8b80ca..13a25f4cf4 100644 --- a/src/Kunstmaan/CookieBundle/Controller/LegalController.php +++ b/src/Kunstmaan/CookieBundle/Controller/LegalController.php @@ -30,11 +30,11 @@ public function __construct(LegalCookieHelper $cookieHelper, EntityManagerInterf } /** - * @Route("/modal/{internal_name}", name="kunstmaancookiebundle_legal_modal") * @Entity("node", expr="repository.getNodeByInternalName(internal_name)") * * @return \Symfony\Component\HttpFoundation\Response */ + #[Route(path: '/modal/{internal_name}', name: 'kunstmaancookiebundle_legal_modal')] public function switchTabAction(Request $request, Node $node) { $page = $node->getNodeTranslation($request->getLocale())->getRef($this->em); @@ -49,11 +49,11 @@ public function switchTabAction(Request $request, Node $node) } /** - * @Route("/detail/{internalName}", name="kunstmaancookiebundle_legal_detail", methods={"GET"}, condition="request.isXmlHttpRequest()") * @ParamConverter("cookieType", options={"mapping": {"internalName": "internalName"}}) * * @return \Symfony\Component\HttpFoundation\Response */ + #[Route(path: '/detail/{internalName}', name: 'kunstmaancookiebundle_legal_detail', methods: ['GET'], condition: 'request.isXmlHttpRequest()')] public function cookieDetailAction(Request $request, CookieType $cookieType) { return $this->render( @@ -65,10 +65,9 @@ public function cookieDetailAction(Request $request, CookieType $cookieType) } /** - * @Route("/toggle-cookies", name="kunstmaancookiebundle_legal_toggle_cookies") - * * @return JsonResponse */ + #[Route(path: '/toggle-cookies', name: 'kunstmaancookiebundle_legal_toggle_cookies')] public function toggleCookiesAction(Request $request) { $cookieTypes = $request->request->all(); @@ -86,10 +85,9 @@ public function toggleCookiesAction(Request $request) } /** - * @Route("/toggle-all-cookies", name="kunstmaancookiebundle_legal_toggle_all_cookies") - * * @return JsonResponse */ + #[Route(path: '/toggle-all-cookies', name: 'kunstmaancookiebundle_legal_toggle_all_cookies')] public function toggleAllCookiesAction(Request $request) { $legalCookie = $this->cookieHelper->findOrCreateLegalCookie($request); diff --git a/src/Kunstmaan/CookieBundle/Entity/Cookie.php b/src/Kunstmaan/CookieBundle/Entity/Cookie.php index 7cb2506eb9..bb0dbbf741 100644 --- a/src/Kunstmaan/CookieBundle/Entity/Cookie.php +++ b/src/Kunstmaan/CookieBundle/Entity/Cookie.php @@ -20,11 +20,11 @@ class Cookie extends AbstractEntity * @var string * * @Gedmo\Translatable() - * @Assert\NotBlank() * @ORM\Column(name="name", type="string", length=255, nullable=true) */ #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: true)] #[Gedmo\Translatable] + #[Assert\NotBlank] private $name; /** @@ -38,21 +38,21 @@ class Cookie extends AbstractEntity private $description; /** - * @Assert\NotBlank() * @ORM\ManyToOne(targetEntity="Kunstmaan\CookieBundle\Entity\CookieType", inversedBy="cookies") * @ORM\JoinColumn(name="type_id", referencedColumnName="id", nullable=false) */ #[ORM\ManyToOne(targetEntity: CookieType::class, inversedBy: 'cookies')] #[ORM\JoinColumn(name: 'type_id', referencedColumnName: 'id', nullable: false)] + #[Assert\NotBlank] private $type; /** * @var string * - * @Assert\NotNull() * @ORM\Column(name="domain", type="string", length=255, nullable=true) */ #[ORM\Column(name: 'domain', type: 'string', length: 255, nullable: true)] + #[Assert\NotNull] private $domain; /** diff --git a/src/Kunstmaan/CookieBundle/Entity/CookieType.php b/src/Kunstmaan/CookieBundle/Entity/CookieType.php index 54d68191a6..1d046e5adc 100644 --- a/src/Kunstmaan/CookieBundle/Entity/CookieType.php +++ b/src/Kunstmaan/CookieBundle/Entity/CookieType.php @@ -23,11 +23,11 @@ class CookieType extends AbstractEntity implements OverviewNavigationInterface * @var string * * @Gedmo\Translatable() - * @Assert\NotBlank() * @ORM\Column(name="name", type="string", length=255, nullable=true) */ #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: true)] #[Gedmo\Translatable] + #[Assert\NotBlank] private $name; /** @@ -53,10 +53,10 @@ class CookieType extends AbstractEntity implements OverviewNavigationInterface /** * @var string * - * @Assert\NotBlank() * @ORM\Column(name="internal_name", type="string", length=255, nullable=true) */ #[ORM\Column(name: 'internal_name', type: 'string', length: 255, nullable: true)] + #[Assert\NotBlank] private $internalName; /** @@ -87,8 +87,6 @@ public function __construct() } /** - * Set name - * * @param string $name * * @return CookieType @@ -101,8 +99,6 @@ public function setName($name) } /** - * Get name - * * @return string */ public function getName() @@ -111,8 +107,6 @@ public function getName() } /** - * Set shortDescription - * * @param string $shortDescription * * @return CookieType @@ -125,8 +119,6 @@ public function setShortDescription($shortDescription) } /** - * Get shortDescription - * * @return string */ public function getShortDescription() @@ -135,8 +127,6 @@ public function getShortDescription() } /** - * Set longDescription - * * @param string $longDescription * * @return CookieType @@ -149,8 +139,6 @@ public function setLongDescription($longDescription) } /** - * Get longDescription - * * @return string */ public function getLongDescription() @@ -159,8 +147,6 @@ public function getLongDescription() } /** - * Set internalName - * * @param string $internalName * * @return CookieType @@ -173,8 +159,6 @@ public function setInternalName($internalName) } /** - * Get internalName - * * @return string */ public function getInternalName() @@ -183,8 +167,6 @@ public function getInternalName() } /** - * Set weight - * * @param int $weight * * @return CookieType @@ -197,8 +179,6 @@ public function setWeight($weight) } /** - * Get weight - * * @return int */ public function getWeight() @@ -207,8 +187,6 @@ public function getWeight() } /** - * Set alwaysOn - * * @param bool $alwaysOn * * @return CookieType @@ -221,8 +199,6 @@ public function setAlwaysOn($alwaysOn) } /** - * Get alwaysOn - * * @return bool */ public function isAlwaysOn() @@ -231,8 +207,6 @@ public function isAlwaysOn() } /** - * Get alwaysOn - * * @return bool */ public function getAlwaysOn() @@ -261,8 +235,6 @@ public function removeCooky(Cookie $cookie) } /** - * Get cookies - * * @return Collection */ public function getCookies() diff --git a/src/Kunstmaan/DashboardBundle/Controller/DashboardController.php b/src/Kunstmaan/DashboardBundle/Controller/DashboardController.php index 37c657ae58..d499d1aba0 100644 --- a/src/Kunstmaan/DashboardBundle/Controller/DashboardController.php +++ b/src/Kunstmaan/DashboardBundle/Controller/DashboardController.php @@ -21,10 +21,9 @@ public function __construct(WidgetManager $widgetManager) /** * The index action will render the main screen the users see when they log in in to the admin * - * @Route("/", name="kunstmaan_dashboard") - * * @return Response */ + #[Route(path: '/', name: 'kunstmaan_dashboard')] public function indexAction(Request $request) { $widgets = $this->widgetManager->getWidgets(); diff --git a/src/Kunstmaan/DashboardBundle/Controller/GoogleAnalyticsAJAXController.php b/src/Kunstmaan/DashboardBundle/Controller/GoogleAnalyticsAJAXController.php index c70509064f..3e7e1e97f6 100644 --- a/src/Kunstmaan/DashboardBundle/Controller/GoogleAnalyticsAJAXController.php +++ b/src/Kunstmaan/DashboardBundle/Controller/GoogleAnalyticsAJAXController.php @@ -39,9 +39,7 @@ public function __construct(KernelInterface $kernel, ConfigHelper $analyticsConf $this->translator = $translator; } - /** - * @Route("/updateData", name="KunstmaanDashboardBundle_analytics_update") - */ + #[Route(path: '/updateData', name: 'KunstmaanDashboardBundle_analytics_update')] public function runUpdateAction(Request $request) { $configId = $request->query->get('configId'); @@ -63,9 +61,8 @@ public function runUpdateAction(Request $request) /** * Return an ajax response with all data for an overview - * - * @Route("/getOverview/{id}", requirements={"id" = "\d+"}, name="KunstmaanDashboardBundle_analytics_overview_ajax") */ + #[Route(path: '/getOverview/{id}', requirements: ['id' => '\d+'], name: 'KunstmaanDashboardBundle_analytics_overview_ajax')] public function getOverviewAction($id) { /** @var AnalyticsOverviewRepository $analyticsOverviewRepository */ @@ -113,10 +110,7 @@ public function getOverviewAction($id) } /* =============================== ACCOUNT =============================== */ - - /** - * @Route("/accounts/", name="kunstmaan_dashboard_ajax_accounts") - */ + #[Route(path: '/accounts/', name: 'kunstmaan_dashboard_ajax_accounts')] public function getAccountsAction(Request $request) { $configId = $request->query->get('configId'); @@ -129,9 +123,7 @@ public function getAccountsAction(Request $request) return new JsonResponse($accounts, 200, ['Content-Type' => 'application/json']); } - /** - * @Route("/account/save", name="kunstmaan_dashboard_ajax_account_save") - */ + #[Route(path: '/account/save', name: 'kunstmaan_dashboard_ajax_account_save')] public function saveAccountAction(Request $request) { $accountId = $request->query->get('id'); @@ -141,10 +133,7 @@ public function saveAccountAction(Request $request) } /* =============================== PROPERTY =============================== */ - - /** - * @Route("/properties/", name="kunstmaan_dashboard_ajax_properties") - */ + #[Route(path: '/properties/', name: 'kunstmaan_dashboard_ajax_properties')] public function getPropertiesAction(Request $request) { $accountId = $request->query->get('accountId'); @@ -158,9 +147,7 @@ public function getPropertiesAction(Request $request) return new JsonResponse($properties, 200, ['Content-Type' => 'application/json']); } - /** - * @Route("/property/save", name="kunstmaan_dashboard_ajax_property_save") - */ + #[Route(path: '/property/save', name: 'kunstmaan_dashboard_ajax_property_save')] public function savePropertyAction(Request $request) { $propertyId = $request->query->get('id'); @@ -170,10 +157,7 @@ public function savePropertyAction(Request $request) } /* =============================== PROFILE =============================== */ - - /** - * @Route("/profiles/", name="kunstmaan_dashboard_ajax_profiles") - */ + #[Route(path: '/profiles/', name: 'kunstmaan_dashboard_ajax_profiles')] public function getProfilesAction(Request $request) { $accountId = $request->query->get('accountId'); @@ -188,9 +172,7 @@ public function getProfilesAction(Request $request) return new JsonResponse($profiles, 200, ['Content-Type' => 'application/json']); } - /** - * @Route("/profile/save", name="kunstmaan_dashboard_ajax_profile_save") - */ + #[Route(path: '/profile/save', name: 'kunstmaan_dashboard_ajax_profile_save')] public function saveProfileAction(Request $request) { $propertyId = $request->query->get('id'); @@ -200,10 +182,7 @@ public function saveProfileAction(Request $request) } /* =============================== CONFIG =============================== */ - - /** - * @Route("/config/save", name="kunstmaan_dashboard_ajax_config_save") - */ + #[Route(path: '/config/save', name: 'kunstmaan_dashboard_ajax_config_save')] public function saveConfigAction(Request $request) { // get params @@ -241,9 +220,7 @@ public function saveConfigAction(Request $request) return new JsonResponse(); } - /** - * @Route("/config/remove", name="kunstmaan_dashboard_ajax_config_remove") - */ + #[Route(path: '/config/remove', name: 'kunstmaan_dashboard_ajax_config_remove')] public function removeConfigAction(Request $request) { // get params @@ -257,9 +234,7 @@ public function removeConfigAction(Request $request) return new JsonResponse(); } - /** - * @Route("/config/get", name="kunstmaan_dashboard_ajax_config_get") - */ + #[Route(path: '/config/get', name: 'kunstmaan_dashboard_ajax_config_get')] public function getConfigAction(Request $request) { $config = $this->em->getRepository(AnalyticsConfig::class)->findFirst(); @@ -275,10 +250,7 @@ public function getConfigAction(Request $request) } /* =============================== SEGMENT =============================== */ - - /** - * @Route("/segment/add/", name="kunstmaan_dashboard_ajax_segment_add") - */ + #[Route(path: '/segment/add/', name: 'kunstmaan_dashboard_ajax_segment_add')] public function addSegmentAction(Request $request) { $configId = $request->query->get('configId'); @@ -303,9 +275,7 @@ public function addSegmentAction(Request $request) return new JsonResponse(); } - /** - * @Route("/segment/delete", name="kunstmaan_dashboard_ajax_segment_delete") - */ + #[Route(path: '/segment/delete', name: 'kunstmaan_dashboard_ajax_segment_delete')] public function deleteSegmentAction(Request $request) { $id = $request->query->get('id'); @@ -314,9 +284,7 @@ public function deleteSegmentAction(Request $request) return new JsonResponse(); } - /** - * @Route("/segment/edit", name="kunstmaan_dashboard_ajax_segment_edit") - */ + #[Route(path: '/segment/edit', name: 'kunstmaan_dashboard_ajax_segment_edit')] public function editSegmentAction(Request $request) { $id = $request->query->get('id'); diff --git a/src/Kunstmaan/DashboardBundle/Controller/GoogleAnalyticsController.php b/src/Kunstmaan/DashboardBundle/Controller/GoogleAnalyticsController.php index 2e76020a02..f5061d7b72 100644 --- a/src/Kunstmaan/DashboardBundle/Controller/GoogleAnalyticsController.php +++ b/src/Kunstmaan/DashboardBundle/Controller/GoogleAnalyticsController.php @@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; final class GoogleAnalyticsController extends AbstractController { @@ -35,9 +34,8 @@ public function __construct(ConfigHelper $analyticsConfig, ClientHelper $clientH /** * The index action will render the main screen the users see when they log in in to the admin - * - * @Route("/", name="KunstmaanDashboardBundle_widget_googleanalytics") */ + #[Route(path: '/', name: 'KunstmaanDashboardBundle_widget_googleanalytics')] public function widgetAction(Request $request): Response { $params['redirect_uri'] = $this->container->get('router')->generate('KunstmaanDashboardBundle_setToken', [], UrlGeneratorInterface::ABSOLUTE_URL); @@ -93,11 +91,7 @@ public function widgetAction(Request $request): Response return $this->render('@KunstmaanDashboard/GoogleAnalytics/widget.html.twig', $params); } - /** - * @Route("/setToken/", name="KunstmaanDashboardBundle_setToken") - * - * @throws AccessDeniedException - */ + #[Route(path: '/setToken/', name: 'KunstmaanDashboardBundle_setToken')] public function setTokenAction(Request $request): RedirectResponse { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -116,11 +110,7 @@ public function setTokenAction(Request $request): RedirectResponse return $this->redirectToRoute('KunstmaanDashboardBundle_widget_googleanalytics'); } - /** - * @Route("/config", name="KunstmaanDashboardBundle_Config") - * - * @throws AccessDeniedException - */ + #[Route(path: '/config', name: 'KunstmaanDashboardBundle_Config')] public function configAction(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -157,11 +147,7 @@ public function configAction(Request $request): Response return $this->render('@KunstmaanDashboard/GoogleAnalytics/setupcontainer.html.twig', $params); } - /** - * @Route("/resetProfile", name="KunstmaanDashboardBundle_analytics_resetProfile") - * - * @throws AccessDeniedException - */ + #[Route(path: '/resetProfile', name: 'KunstmaanDashboardBundle_analytics_resetProfile')] public function resetProfileAction(): RedirectResponse { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -171,11 +157,7 @@ public function resetProfileAction(): RedirectResponse return $this->redirectToRoute('KunstmaanDashboardBundle_ProfileSelection'); } - /** - * @Route("/resetProperty", name="KunstmaanDashboardBundle_analytics_resetProperty") - * - * @throws AccessDeniedException - */ + #[Route(path: '/resetProperty', name: 'KunstmaanDashboardBundle_analytics_resetProperty')] public function resetPropertyAction(): RedirectResponse { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); diff --git a/src/Kunstmaan/FormBundle/Controller/FormSubmissionsController.php b/src/Kunstmaan/FormBundle/Controller/FormSubmissionsController.php index 3bfa333154..a5da3f4078 100644 --- a/src/Kunstmaan/FormBundle/Controller/FormSubmissionsController.php +++ b/src/Kunstmaan/FormBundle/Controller/FormSubmissionsController.php @@ -42,9 +42,8 @@ public function __construct(EntityManagerInterface $em) /** * The index action will use an admin list to list all the form pages - * - * @Route("/", name="KunstmaanFormBundle_formsubmissions") */ + #[Route(path: '/', name: 'KunstmaanFormBundle_formsubmissions')] public function indexAction(Request $request): Response { $aclHelper = $this->container->get('kunstmaan_admin.acl.helper'); @@ -62,9 +61,8 @@ public function indexAction(Request $request): Response * The list action will use an admin list to list all the form submissions related to the given $nodeTranslationId * * @param int $nodeTranslationId - * - * @Route("/list/{nodeTranslationId}", requirements={"nodeTranslationId" = "\d+"}, name="KunstmaanFormBundle_formsubmissions_list", methods={"GET", "POST"}) */ + #[Route(path: '/list/{nodeTranslationId}', requirements: ['nodeTranslationId' => '\d+'], name: 'KunstmaanFormBundle_formsubmissions_list', methods: ['GET', 'POST'])] public function listAction(Request $request, $nodeTranslationId): Response { $nodeTranslation = $this->em->getRepository(NodeTranslation::class)->find($nodeTranslationId); @@ -86,10 +84,8 @@ public function listAction(Request $request, $nodeTranslationId): Response * * @param int $nodeTranslationId The node translation id * @param int $submissionId The submission id - * - * @Route("/list/{nodeTranslationId}/{submissionId}", requirements={"nodeTranslationId" = "\d+", "submissionId" = - * "\d+"}, name="KunstmaanFormBundle_formsubmissions_list_edit", methods={"GET", "POST"}) */ + #[Route(path: '/list/{nodeTranslationId}/{submissionId}', requirements: ['nodeTranslationId' => '\d+', 'submissionId' => '\d+'], name: 'KunstmaanFormBundle_formsubmissions_list_edit', methods: ['GET', 'POST'])] public function editAction($nodeTranslationId, $submissionId): Response { $nodeTranslation = $this->em->getRepository(NodeTranslation::class)->find($nodeTranslationId); @@ -115,11 +111,9 @@ public function editAction($nodeTranslationId, $submissionId): Response * * @param int $nodeTranslationId * - * @Route("/export/{nodeTranslationId}.{_format}", requirements={"nodeTranslationId" = "\d+","_format" = - * "csv|xlsx|ods"}, name="KunstmaanFormBundle_formsubmissions_export", methods={"GET"}) - * * @return Response */ + #[Route(path: '/export/{nodeTranslationId}.{_format}', requirements: ['nodeTranslationId' => '\d+', '_format' => 'csv|xlsx|ods'], name: 'KunstmaanFormBundle_formsubmissions_export', methods: ['GET'])] public function exportAction($nodeTranslationId, $_format) { /** @var NodeTranslation $nodeTranslation */ @@ -134,17 +128,11 @@ public function exportAction($nodeTranslationId, $_format) } /** - * @Route( - * "/{id}/delete", - * requirements={"id" = "\d+"}, - * name="KunstmaanFormBundle_formsubmissions_delete", - * methods={"POST"} - * ) - * * @param int $id * * @return RedirectResponse */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'KunstmaanFormBundle_formsubmissions_delete', methods: ['POST'])] public function deleteAction(Request $request, $id) { $submission = $this->em->getRepository(FormSubmission::class)->find($id); diff --git a/src/Kunstmaan/FormBundle/Entity/AbstractFormPage.php b/src/Kunstmaan/FormBundle/Entity/AbstractFormPage.php index fb53143d81..fd96d13d5c 100644 --- a/src/Kunstmaan/FormBundle/Entity/AbstractFormPage.php +++ b/src/Kunstmaan/FormBundle/Entity/AbstractFormPage.php @@ -25,10 +25,10 @@ abstract class AbstractFormPage extends AbstractPage implements FormPageInterfac /** * The thank you text to be shown when the form was successfully submitted * - * @Assert\NotBlank() * @ORM\Column(type="text", nullable=true) */ #[ORM\Column(name: 'thanks', type: 'text', nullable: true)] + #[Assert\NotBlank] protected $thanks; /** @@ -43,9 +43,9 @@ abstract class AbstractFormPage extends AbstractPage implements FormPageInterfac * The sender of the administrative email * * @ORM\Column(type="string", name="from_email", nullable=true) - * @Assert\Email() */ #[ORM\Column(name: 'from_email', type: 'string', nullable: true)] + #[Assert\Email] protected $fromEmail; /** diff --git a/src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/FileFormSubmissionField.php b/src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/FileFormSubmissionField.php index 0609c99384..3301d6d36f 100644 --- a/src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/FileFormSubmissionField.php +++ b/src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/FileFormSubmissionField.php @@ -54,10 +54,9 @@ class FileFormSubmissionField extends FormSubmissionField /** * Non-persistent storage of upload file * - * @Assert\File(maxSize="6000000") - * * @var UploadedFile */ + #[Assert\File(maxSize: '6000000')] public $file; /** diff --git a/src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/StringFormSubmissionField.php b/src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/StringFormSubmissionField.php index fe6abfc6e8..c4ba849c7f 100644 --- a/src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/StringFormSubmissionField.php +++ b/src/Kunstmaan/FormBundle/Entity/FormSubmissionFieldTypes/StringFormSubmissionField.php @@ -19,9 +19,9 @@ class StringFormSubmissionField extends FormSubmissionField { /** * @ORM\Column(name="sfsf_value", type="string") - * @Assert\Length(max=255) */ #[ORM\Column(name: 'sfsf_value', type: 'string')] + #[Assert\Length(max: 255)] protected $value; /** diff --git a/src/Kunstmaan/FormBundle/Entity/PageParts/AbstractFormPagePart.php b/src/Kunstmaan/FormBundle/Entity/PageParts/AbstractFormPagePart.php index ec6d7f2e12..4d94cb80e4 100644 --- a/src/Kunstmaan/FormBundle/Entity/PageParts/AbstractFormPagePart.php +++ b/src/Kunstmaan/FormBundle/Entity/PageParts/AbstractFormPagePart.php @@ -14,13 +14,11 @@ abstract class AbstractFormPagePart extends AbstractPagePart implements FormAdaptorInterface { /** - * The label - * * @ORM\Column(type="string") - * @Assert\NotBlank() - * @Assert\Length(max=255) */ #[ORM\Column(name: 'label', type: 'string')] + #[Assert\NotBlank] + #[Assert\Length(max: 255)] protected $label; /** diff --git a/src/Kunstmaan/FormBundle/Entity/PageParts/CheckboxPagePart.php b/src/Kunstmaan/FormBundle/Entity/PageParts/CheckboxPagePart.php index d42f694ad7..fc8bf565cb 100644 --- a/src/Kunstmaan/FormBundle/Entity/PageParts/CheckboxPagePart.php +++ b/src/Kunstmaan/FormBundle/Entity/PageParts/CheckboxPagePart.php @@ -32,9 +32,9 @@ class CheckboxPagePart extends AbstractFormPagePart * Error message shows when the page part is required and nothing is filled in * * @ORM\Column(type="string", name="error_message_required", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'error_message_required', type: 'string', nullable: true)] + #[Length(max: 255)] protected $errorMessageRequired; /** diff --git a/src/Kunstmaan/FormBundle/Entity/PageParts/ChoicePagePart.php b/src/Kunstmaan/FormBundle/Entity/PageParts/ChoicePagePart.php index aab64c3c53..93b2249265 100644 --- a/src/Kunstmaan/FormBundle/Entity/PageParts/ChoicePagePart.php +++ b/src/Kunstmaan/FormBundle/Entity/PageParts/ChoicePagePart.php @@ -54,9 +54,9 @@ class ChoicePagePart extends AbstractFormPagePart * multiple options are set to false. * * @ORM\Column(type="string", name="empty_value", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'empty_value', type: 'string', nullable: true)] + #[Length(max: 255)] protected $emptyValue; /** @@ -71,9 +71,9 @@ class ChoicePagePart extends AbstractFormPagePart * Error message shows when the page part is required and nothing is filled in * * @ORM\Column(type="string", name="error_message_required", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'error_message_required', type: 'string', nullable: true)] + #[Length(max: 255)] protected $errorMessageRequired; /** diff --git a/src/Kunstmaan/FormBundle/Entity/PageParts/EmailPagePart.php b/src/Kunstmaan/FormBundle/Entity/PageParts/EmailPagePart.php index 9389cbdb56..4a6bb5f25f 100644 --- a/src/Kunstmaan/FormBundle/Entity/PageParts/EmailPagePart.php +++ b/src/Kunstmaan/FormBundle/Entity/PageParts/EmailPagePart.php @@ -33,18 +33,18 @@ class EmailPagePart extends AbstractFormPagePart * Error message shows when the page part is required and nothing is filled in * * @ORM\Column(type="string", name="error_message_required", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'error_message_required', type: 'string', nullable: true)] + #[Length(max: 255)] protected $errorMessageRequired; /** * Error message shows when the value is invalid * * @ORM\Column(type="string", name="error_message_invalid", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'error_message_invalid', type: 'string', nullable: true)] + #[Length(max: 255)] protected $errorMessageInvalid; /** diff --git a/src/Kunstmaan/FormBundle/Entity/PageParts/FileUploadPagePart.php b/src/Kunstmaan/FormBundle/Entity/PageParts/FileUploadPagePart.php index 41439f4855..2f734093bd 100644 --- a/src/Kunstmaan/FormBundle/Entity/PageParts/FileUploadPagePart.php +++ b/src/Kunstmaan/FormBundle/Entity/PageParts/FileUploadPagePart.php @@ -34,9 +34,9 @@ class FileUploadPagePart extends AbstractFormPagePart * Error message shows when the page part is required and nothing is filled in * * @ORM\Column(type="string", name="error_message_required", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'error_message_required', type: 'string', nullable: true)] + #[Length(max: 255)] protected $errorMessageRequired; /** diff --git a/src/Kunstmaan/FormBundle/Entity/PageParts/MultiLineTextPagePart.php b/src/Kunstmaan/FormBundle/Entity/PageParts/MultiLineTextPagePart.php index 565fef6be6..681386946e 100644 --- a/src/Kunstmaan/FormBundle/Entity/PageParts/MultiLineTextPagePart.php +++ b/src/Kunstmaan/FormBundle/Entity/PageParts/MultiLineTextPagePart.php @@ -33,27 +33,27 @@ class MultiLineTextPagePart extends AbstractFormPagePart * Error message shows when the page part is required and nothing is filled in * * @ORM\Column(type="string", name="error_message_required", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'error_message_required', type: 'string', nullable: true)] + #[Length(max: 255)] protected $errorMessageRequired; /** * If set the entered value will be matched with this regular expression * * @ORM\Column(type="string", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'regex', type: 'string', nullable: true)] + #[Length(max: 255)] protected $regex; /** * If a regular expression is set and it doesn't match with the given value, this error message will be shown * * @ORM\Column(type="string", name="error_message_regex", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'error_message_regex', type: 'string', nullable: true)] + #[Length(max: 255)] protected $errorMessageRegex; /** diff --git a/src/Kunstmaan/FormBundle/Entity/PageParts/SingleLineTextPagePart.php b/src/Kunstmaan/FormBundle/Entity/PageParts/SingleLineTextPagePart.php index 610b74130e..e3fdd9313a 100644 --- a/src/Kunstmaan/FormBundle/Entity/PageParts/SingleLineTextPagePart.php +++ b/src/Kunstmaan/FormBundle/Entity/PageParts/SingleLineTextPagePart.php @@ -33,27 +33,27 @@ class SingleLineTextPagePart extends AbstractFormPagePart * Error message shows when the page part is required and nothing is filled in * * @ORM\Column(type="string", name="error_message_required", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'error_message_required', type: 'string', nullable: true)] + #[Length(max: 255)] protected $errorMessageRequired; /** * If set the entered value will be matched with this regular expression * * @ORM\Column(type="string", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'regex', type: 'string', nullable: true)] + #[Length(max: 255)] protected $regex; /** * If a regular expression is set and it doesn't match with the given value, this error message will be shown * * @ORM\Column(type="string", name="error_message_regex", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'error_message_regex', type: 'string', nullable: true)] + #[Length(max: 255)] protected $errorMessageRegex; /** diff --git a/src/Kunstmaan/FormBundle/Entity/PageParts/SubmitButtonPagePart.php b/src/Kunstmaan/FormBundle/Entity/PageParts/SubmitButtonPagePart.php index 103cc55297..09d1b3e479 100644 --- a/src/Kunstmaan/FormBundle/Entity/PageParts/SubmitButtonPagePart.php +++ b/src/Kunstmaan/FormBundle/Entity/PageParts/SubmitButtonPagePart.php @@ -21,9 +21,9 @@ class SubmitButtonPagePart extends AbstractPagePart * The label on the submit button * * @ORM\Column(type="string", nullable=true) - * @Length(max=255) */ #[ORM\Column(name: 'label', type: 'string', nullable: true)] + #[Length(max: 255)] protected $label; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Controller/AbstractNewsletterController.php b/src/Kunstmaan/LeadGenerationBundle/Controller/AbstractNewsletterController.php index aa7210e3c9..b678885d11 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Controller/AbstractNewsletterController.php +++ b/src/Kunstmaan/LeadGenerationBundle/Controller/AbstractNewsletterController.php @@ -26,9 +26,7 @@ public function __construct(EntityManagerInterface $em = null) $this->em = $em; } - /** - * @Route("/{popup}", name="popup_newsletter_index", requirements={"popup": "\d+"}) - */ + #[Route(path: '/{popup}', name: 'popup_newsletter_index', requirements: ['popup' => '\d+'])] public function indexAction($popup) { // NEXT_MAJOR remove getDoctrine fallback @@ -44,10 +42,9 @@ public function indexAction($popup) } /** - * @Route("/{popup}/subscribe", name="popup_newsletter_subscribe", requirements={"popup": "\d+"}, methods={"POST"}) - * * @return Response */ + #[Route(path: '/{popup}/subscribe', name: 'popup_newsletter_subscribe', requirements: ['popup' => '\d+'], methods: ['POST'])] public function subscribeAction(Request $request, $popup) { // NEXT_MAJOR remove getDoctrine fallback diff --git a/src/Kunstmaan/LeadGenerationBundle/Controller/AbstractRedirectController.php b/src/Kunstmaan/LeadGenerationBundle/Controller/AbstractRedirectController.php index 1ff0168bbe..c30f998fc8 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Controller/AbstractRedirectController.php +++ b/src/Kunstmaan/LeadGenerationBundle/Controller/AbstractRedirectController.php @@ -21,9 +21,7 @@ public function __construct(EntityManagerInterface $em = null) $this->em = $em; } - /** - * @Route("/{popup}", name="redirect_index", requirements={"popup": "\d+"}) - */ + #[Route(path: '/{popup}', name: 'redirect_index', requirements: ['popup' => '\d+'])] public function indexAction($popup) { // NEXT_MAJOR remove getDoctrine fallback diff --git a/src/Kunstmaan/LeadGenerationBundle/Controller/PopupsAdminListController.php b/src/Kunstmaan/LeadGenerationBundle/Controller/PopupsAdminListController.php index 9c9e692c6f..2e25e979a3 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Controller/PopupsAdminListController.php +++ b/src/Kunstmaan/LeadGenerationBundle/Controller/PopupsAdminListController.php @@ -8,6 +8,7 @@ use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController; use Kunstmaan\LeadGenerationBundle\AdminList\PopupAdminListConfigurator; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; final class PopupsAdminListController extends AbstractAdminListController @@ -40,50 +41,40 @@ public function getAdminListConfigurator($listAction = false) } /** - * The index action - * - * @Route("/", name="kunstmaanleadgenerationbundle_admin_popup_abstractpopup") + * @return Response */ + #[Route(path: '/', name: 'kunstmaanleadgenerationbundle_admin_popup_abstractpopup')] public function indexAction(Request $request) { return parent::doIndexAction($this->getAdminListConfigurator(true), $request); } /** - * The delete action - * * @param int $id * - * @Route("/{id}/delete", requirements={"id" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_popup_abstractpopup_delete", methods={"GET", "POST"}) - * - * @return array + * @return Response */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'kunstmaanleadgenerationbundle_admin_popup_abstractpopup_delete', methods: ['GET', 'POST'])] public function deleteAction(Request $request, $id) { return parent::doDeleteAction($this->getAdminListConfigurator(), $id, $request); } /** - * The edit action - * * @param int $id * - * @Route("/{id}/edit", requirements={"id" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_popup_abstractpopup_edit", methods={"GET", "POST"}) - * - * @return array + * @return Response */ + #[Route(path: '/{id}/edit', requirements: ['id' => '\d+'], name: 'kunstmaanleadgenerationbundle_admin_popup_abstractpopup_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id) { return parent::doEditAction($this->getAdminListConfigurator(), $id, $request); } /** - * The add action - * - * @Route("/add", name="kunstmaanleadgenerationbundle_admin_popup_abstractpopup_add", methods={"GET", "POST"}) - * - * @return array + * @return Response */ + #[Route(path: '/add', name: 'kunstmaanleadgenerationbundle_admin_popup_abstractpopup_add', methods: ['GET', 'POST'])] public function addAction(Request $request) { $type = $request->query->get('type'); diff --git a/src/Kunstmaan/LeadGenerationBundle/Controller/RulesAdminListController.php b/src/Kunstmaan/LeadGenerationBundle/Controller/RulesAdminListController.php index 7703ecebce..d4606d7339 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Controller/RulesAdminListController.php +++ b/src/Kunstmaan/LeadGenerationBundle/Controller/RulesAdminListController.php @@ -6,6 +6,7 @@ use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController; use Kunstmaan\LeadGenerationBundle\AdminList\RulesAdminListConfigurator; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; final class RulesAdminListController extends AbstractAdminListController @@ -27,23 +28,16 @@ public function getAdminListConfigurator($id) return $this->configurator; } - /** - * The detail action - * - * @Route("/{popup}/rules", requirements={"popup" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_rule_abstractrule_detail") - */ + #[Route(path: '/{popup}/rules', requirements: ['popup' => '\d+'], name: 'kunstmaanleadgenerationbundle_admin_rule_abstractrule_detail')] public function detailAction(Request $request, $popup) { return parent::doIndexAction($this->getAdminListConfigurator($popup), $request); } /** - * The add action - * - * @Route("/{popup}/add", requirements={"popup" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_rule_abstractrule_add", methods={"GET", "POST"}) - * - * @return array + * @return Response */ + #[Route(path: '/{popup}/add', requirements: ['popup' => '\d+'], name: 'kunstmaanleadgenerationbundle_admin_rule_abstractrule_add', methods: ['GET', 'POST'])] public function addAction(Request $request, $popup) { $type = $request->query->get('type'); @@ -52,28 +46,22 @@ public function addAction(Request $request, $popup) } /** - * The edit action - * * @param int $id * - * @Route("/{popup}/rules/{id}/edit", requirements={"popup" = "\d+", "rule" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_rule_abstractrule_edit", methods={"GET", "POST"}) - * - * @return array + * @return Response */ + #[Route(path: '/{popup}/rules/{id}/edit', requirements: ['popup' => '\d+', 'rule' => '\d+'], name: 'kunstmaanleadgenerationbundle_admin_rule_abstractrule_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id, $popup) { return parent::doEditAction($this->getAdminListConfigurator($popup), $id, $request); } /** - * The delete action - * * @param int $id * - * @Route("/{popup}/rules/{id}/delete", requirements={"popup" = "\d+"}, name="kunstmaanleadgenerationbundle_admin_rule_abstractrule_delete", methods={"GET", "POST"}) - * - * @return array + * @return Response */ + #[Route(path: '/{popup}/rules/{id}/delete', requirements: ['popup' => '\d+'], name: 'kunstmaanleadgenerationbundle_admin_rule_abstractrule_delete', methods: ['GET', 'POST'])] public function deleteAction(Request $request, $id, $popup) { return parent::doDeleteAction($this->getAdminListConfigurator($popup), $id, $request); diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Popup/AbstractPopup.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Popup/AbstractPopup.php index e736ba3312..3adfa12766 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Popup/AbstractPopup.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Popup/AbstractPopup.php @@ -14,13 +14,13 @@ * @ORM\Table(name="kuma_popup") * @ORM\InheritanceType("SINGLE_TABLE") * @ORM\DiscriminatorColumn(name="discr", type="string") - * @UniqueEntity(fields={"name"}) */ #[ORM\Entity] #[ORM\Table(name: 'kuma_popup')] #[ORM\InheritanceType('SINGLE_TABLE')] #[ORM\DiscriminatorColumn(name: 'discr', type: 'string')] #[UniqueEntity(fields: ['name'])] +#[UniqueEntity(fields: ['name'])] abstract class AbstractPopup implements EntityInterface { /** @@ -37,18 +37,18 @@ abstract class AbstractPopup implements EntityInterface * @var string an unique name for each popup * * @ORM\Column(type="string", name="name", unique=true) - * @Assert\NotBlank() */ #[ORM\Column(name: 'name', type: 'string', unique: true)] + #[Assert\NotBlank] protected $name; /** * @var string the html element id of the popup * * @ORM\Column(type="string", name="html_id") - * @Assert\NotBlank() */ #[ORM\Column(name: 'html_id', type: 'string')] + #[Assert\NotBlank] protected $htmlId; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXScrollPercentRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXScrollPercentRule.php index 593e3d21eb..326d67032f 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXScrollPercentRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXScrollPercentRule.php @@ -18,10 +18,10 @@ class AfterXScrollPercentRule extends AbstractRule * @var int * * @ORM\Column(type="integer") - * @Assert\NotBlank() - * @Assert\Range(min = 0, max = 100) */ #[ORM\Column(name: 'percentage', type: 'integer')] + #[Assert\NotBlank] + #[Assert\Range(min: 0, max: 100)] private $percentage; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXSecondsRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXSecondsRule.php index bd7d906536..d163ad58c8 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXSecondsRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXSecondsRule.php @@ -18,10 +18,10 @@ class AfterXSecondsRule extends AbstractRule * @var int * * @ORM\Column(type="integer") - * @Assert\NotBlank() - * @Assert\GreaterThanOrEqual(0) */ #[ORM\Column(name: 'seconds', type: 'integer')] + #[Assert\NotBlank] + #[Assert\GreaterThanOrEqual(0)] private $seconds; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/LocaleBlacklistRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/LocaleBlacklistRule.php index 2034918233..880f1b2b34 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/LocaleBlacklistRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/LocaleBlacklistRule.php @@ -18,9 +18,9 @@ class LocaleBlacklistRule extends AbstractRule * @var string * * @ORM\Column(name="locale", type="text", nullable=true) - * @Assert\NotBlank() */ #[ORM\Column(name: 'locale', type: 'text', nullable: true)] + #[Assert\NotBlank] private $locale; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/LocaleWhitelistRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/LocaleWhitelistRule.php index 851b9e830d..98afb70270 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/LocaleWhitelistRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/LocaleWhitelistRule.php @@ -18,9 +18,9 @@ class LocaleWhitelistRule extends AbstractRule * @var string * * @ORM\Column(name="locale", type="text", nullable=true) - * @Assert\NotBlank() */ #[ORM\Column(name: 'locale', type: 'text', nullable: true)] + #[Assert\NotBlank] private $locale; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/MaxXTimesRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/MaxXTimesRule.php index f380e429f2..56e39ee110 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/MaxXTimesRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/MaxXTimesRule.php @@ -18,10 +18,10 @@ class MaxXTimesRule extends AbstractRule * @var int * * @ORM\Column(type="integer", nullable=true) - * @Assert\NotBlank() - * @Assert\GreaterThanOrEqual(0) */ #[ORM\Column(name: 'times', type: 'integer', nullable: true)] + #[Assert\NotBlank] + #[Assert\GreaterThanOrEqual(0)] private $times; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/OnExitIntentRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/OnExitIntentRule.php index 076642a05e..413bb55817 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/OnExitIntentRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/OnExitIntentRule.php @@ -18,27 +18,27 @@ class OnExitIntentRule extends AbstractRule * @var int * * @ORM\Column(type="integer", nullable=true) - * @Assert\GreaterThanOrEqual(0) */ #[ORM\Column(name: 'sensitivity', type: 'integer', nullable: true)] + #[Assert\GreaterThanOrEqual(0)] private $sensitivity; /** * @var int * * @ORM\Column(type="integer", nullable=true) - * @Assert\GreaterThanOrEqual(0) */ #[ORM\Column(name: 'timer', type: 'integer', nullable: true)] + #[Assert\GreaterThanOrEqual(0)] private $timer; /** * @var int * * @ORM\Column(type="integer", nullable=true) - * @Assert\GreaterThanOrEqual(0) */ #[ORM\Column(name: 'delay', type: 'integer', nullable: true)] + #[Assert\GreaterThanOrEqual(0)] private $delay; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/RecurringEveryXTimeRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/RecurringEveryXTimeRule.php index b2ac29b669..645383d8b1 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/RecurringEveryXTimeRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/RecurringEveryXTimeRule.php @@ -18,37 +18,37 @@ class RecurringEveryXTimeRule extends AbstractRule * @var int * * @ORM\Column(type="integer", nullable=true) - * @Assert\GreaterThanOrEqual(0) */ #[ORM\Column(name: 'minutes', type: 'integer', nullable: true)] + #[Assert\GreaterThanOrEqual(0)] private $minutes; /** * @var int * * @ORM\Column(type="integer", nullable=true) - * @Assert\GreaterThanOrEqual(0) */ #[ORM\Column(name: 'hours', type: 'integer', nullable: true)] + #[Assert\GreaterThanOrEqual(0)] private $hours; /** * @var int * * @ORM\Column(type="integer", nullable=true) - * @Assert\GreaterThanOrEqual(0) */ #[ORM\Column(name: 'days', type: 'integer', nullable: true)] + #[Assert\GreaterThanOrEqual(0)] private $days; /** * @var int * * @ORM\Column(type="integer", nullable=true) - * @Assert\GreaterThanOrEqual(0) - * @Assert\NotBlank() */ #[ORM\Column(name: 'times', type: 'integer', nullable: true)] + #[Assert\GreaterThanOrEqual(0)] + #[Assert\NotBlank] private $times; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/UrlBlacklistRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/UrlBlacklistRule.php index 772f179982..bf083cb3d5 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/UrlBlacklistRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/UrlBlacklistRule.php @@ -18,9 +18,9 @@ class UrlBlacklistRule extends AbstractRule * @var string * * @ORM\Column(name="urls", type="text", nullable=true) - * @Assert\NotBlank() */ #[ORM\Column(name: 'urls', type: 'text', nullable: true)] + #[Assert\NotBlank] private $urls; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/UrlWhitelistRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/UrlWhitelistRule.php index e8977f1b0e..a9f7cf1e11 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/UrlWhitelistRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/UrlWhitelistRule.php @@ -18,9 +18,9 @@ class UrlWhitelistRule extends AbstractRule * @var string * * @ORM\Column(name="urls", type="text", nullable=true) - * @Assert\NotBlank() */ #[ORM\Column(name: 'urls', type: 'text', nullable: true)] + #[Assert\NotBlank] private $urls; /** diff --git a/src/Kunstmaan/MediaBundle/Controller/ChooserController.php b/src/Kunstmaan/MediaBundle/Controller/ChooserController.php index 05a836c733..3065dec404 100644 --- a/src/Kunstmaan/MediaBundle/Controller/ChooserController.php +++ b/src/Kunstmaan/MediaBundle/Controller/ChooserController.php @@ -39,9 +39,7 @@ public function __construct(MediaManager $mediaManager, FolderManager $folderMan private const TYPE_ALL = 'all'; - /** - * @Route("/chooser", name="KunstmaanMediaBundle_chooser") - */ + #[Route(path: '/chooser', name: 'KunstmaanMediaBundle_chooser')] public function chooserIndexAction(Request $request): RedirectResponse { $session = $request->getSession(); @@ -80,9 +78,8 @@ public function chooserIndexAction(Request $request): RedirectResponse /** * @param int $folderId The folder id - * - * @Route("/chooser/{folderId}", requirements={"folderId" = "\d+"}, name="KunstmaanMediaBundle_chooser_show_folder") */ + #[Route(path: '/chooser/{folderId}', requirements: ['folderId' => '\d+'], name: 'KunstmaanMediaBundle_chooser_show_folder')] public function chooserShowFolderAction(Request $request, $folderId): Response { $session = $request->getSession(); diff --git a/src/Kunstmaan/MediaBundle/Controller/FolderController.php b/src/Kunstmaan/MediaBundle/Controller/FolderController.php index c37235dc8f..24cb3eae3a 100644 --- a/src/Kunstmaan/MediaBundle/Controller/FolderController.php +++ b/src/Kunstmaan/MediaBundle/Controller/FolderController.php @@ -53,9 +53,8 @@ public function __construct( /** * @param int $folderId The folder id - * - * @Route("/{folderId}", requirements={"folderId" = "\d+"}, name="KunstmaanMediaBundle_folder_show") */ + #[Route(path: '/{folderId}', requirements: ['folderId' => '\d+'], name: 'KunstmaanMediaBundle_folder_show')] public function showAction(Request $request, $folderId): Response { $session = $request->getSession(); @@ -114,10 +113,9 @@ public function showAction(Request $request, $folderId): Response /** * @param int $folderId * - * @Route("/delete/{folderId}", requirements={"folderId" = "\d+"}, name="KunstmaanMediaBundle_folder_delete", methods={"POST"}) - * * @return RedirectResponse */ + #[Route(path: '/delete/{folderId}', requirements: ['folderId' => '\d+'], name: 'KunstmaanMediaBundle_folder_delete', methods: ['POST'])] public function deleteAction(Request $request, $folderId) { if (!$this->isCsrfTokenValid('media-folder-delete', $request->request->get('token'))) { @@ -163,10 +161,9 @@ public function deleteAction(Request $request, $folderId) /** * @param int $folderId * - * @Route("/subcreate/{folderId}", requirements={"folderId" = "\d+"}, name="KunstmaanMediaBundle_folder_sub_create", methods={"GET", "POST"}) - * * @return Response */ + #[Route(path: '/subcreate/{folderId}', requirements: ['folderId' => '\d+'], name: 'KunstmaanMediaBundle_folder_sub_create', methods: ['GET', 'POST'])] public function subCreateAction(Request $request, $folderId) { /* @var Folder $parent */ @@ -212,10 +209,9 @@ public function subCreateAction(Request $request, $folderId) /** * @param int $folderId * - * @Route("/empty/{folderId}", requirements={"folderId" = "\d+"}, name="KunstmaanMediaBundle_folder_empty", methods={"GET", "POST"}) - * * @return Response */ + #[Route(path: '/empty/{folderId}', requirements: ['folderId' => '\d+'], name: 'KunstmaanMediaBundle_folder_empty', methods: ['GET', 'POST'])] public function emptyAction(Request $request, $folderId) { /* @var Folder $folder */ @@ -256,10 +252,9 @@ public function emptyAction(Request $request, $folderId) } /** - * @Route("/reorder", name="KunstmaanMediaBundle_folder_reorder") - * * @return JsonResponse */ + #[Route(path: '/reorder', name: 'KunstmaanMediaBundle_folder_reorder')] public function reorderAction(Request $request) { $folders = []; diff --git a/src/Kunstmaan/MediaBundle/Controller/IconFontController.php b/src/Kunstmaan/MediaBundle/Controller/IconFontController.php index 4350d136c5..10005005a4 100644 --- a/src/Kunstmaan/MediaBundle/Controller/IconFontController.php +++ b/src/Kunstmaan/MediaBundle/Controller/IconFontController.php @@ -18,9 +18,7 @@ public function __construct(IconFontManager $iconFontManager) $this->iconFontManager = $iconFontManager; } - /** - * @Route("/chooser", name="KunstmaanMediaBundle_icon_font_chooser") - */ + #[Route(path: '/chooser', name: 'KunstmaanMediaBundle_icon_font_chooser')] public function iconFontChooserAction(Request $request): Response { $loader = $request->query->get('loader'); diff --git a/src/Kunstmaan/MediaBundle/Controller/MediaController.php b/src/Kunstmaan/MediaBundle/Controller/MediaController.php index 759cd732d9..3612797652 100644 --- a/src/Kunstmaan/MediaBundle/Controller/MediaController.php +++ b/src/Kunstmaan/MediaBundle/Controller/MediaController.php @@ -40,10 +40,9 @@ public function __construct(MediaManager $mediaManager, FolderManager $folderMan /** * @param int $mediaId * - * @Route("/{mediaId}", requirements={"mediaId" = "\d+"}, name="KunstmaanMediaBundle_media_show") - * * @return Response */ + #[Route(path: '/{mediaId}', requirements: ['mediaId' => '\d+'], name: 'KunstmaanMediaBundle_media_show')] public function showAction(Request $request, $mediaId) { /* @var Media $media */ @@ -80,10 +79,9 @@ public function showAction(Request $request, $mediaId) /** * @param int $mediaId * - * @Route("/delete/{mediaId}", requirements={"mediaId" = "\d+"}, name="KunstmaanMediaBundle_media_delete", methods={"POST"}) - * * @return RedirectResponse */ + #[Route(path: '/delete/{mediaId}', requirements: ['mediaId' => '\d+'], name: 'KunstmaanMediaBundle_media_delete', methods: ['POST'])] public function deleteAction(Request $request, $mediaId) { if (!$this->isCsrfTokenValid('media-delete', $request->request->get('token'))) { @@ -118,9 +116,8 @@ public function deleteAction(Request $request, $mediaId) /** * @param int $folderId - * - * @Route("bulkupload/{folderId}", requirements={"folderId" = "\d+"}, name="KunstmaanMediaBundle_media_bulk_upload") */ + #[Route(path: 'bulkupload/{folderId}', requirements: ['folderId' => '\d+'], name: 'KunstmaanMediaBundle_media_bulk_upload')] public function bulkUploadAction($folderId): Response { /* @var Folder $folder */ @@ -132,10 +129,9 @@ public function bulkUploadAction($folderId): Response /** * @param int $folderId * - * @Route("bulkuploadsubmit/{folderId}", requirements={"folderId" = "\d+"}, name="KunstmaanMediaBundle_media_bulk_upload_submit", methods={"POST"}) - * * @return JsonResponse */ + #[Route(path: 'bulkuploadsubmit/{folderId}', requirements: ['folderId' => '\d+'], name: 'KunstmaanMediaBundle_media_bulk_upload_submit', methods: ['POST'])] public function bulkUploadSubmitAction(Request $request, $folderId) { // Settings @@ -288,10 +284,9 @@ private function returnJsonError($code, $message) /** * @param int $folderId * - * @Route("drop/{folderId}", requirements={"folderId" = "\d+"}, name="KunstmaanMediaBundle_media_drop_upload", methods={"GET", "POST"}) - * * @return JsonResponse */ + #[Route(path: 'drop/{folderId}', requirements: ['folderId' => '\d+'], name: 'KunstmaanMediaBundle_media_drop_upload', methods: ['GET', 'POST'])] public function dropAction(Request $request, $folderId) { /* @var Folder $folder */ @@ -327,9 +322,8 @@ public function dropAction(Request $request, $folderId) /** * @param int $folderId The folder id * @param string $type The type - * - * @Route("create/{folderId}/{type}", requirements={"folderId" = "\d+", "type" = ".+"}, name="KunstmaanMediaBundle_media_create", methods={"GET", "POST"}) */ + #[Route(path: 'create/{folderId}/{type}', requirements: ['folderId' => '\d+', 'type' => '.+'], name: 'KunstmaanMediaBundle_media_create', methods: ['GET', 'POST'])] public function createAction(Request $request, $folderId, $type): Response { $responseOrData = $this->createAndRedirect($request, $folderId, $type, 'KunstmaanMediaBundle_folder_show'); @@ -409,10 +403,9 @@ private function createAndRedirect(Request $request, $folderId, $type, $redirect * @param int $folderId The folder id * @param string $type The type * - * @Route("create/modal/{folderId}/{type}", requirements={"folderId" = "\d+", "type" = ".+"}, name="KunstmaanMediaBundle_media_modal_create", methods={"POST"}) - * * @return array|RedirectResponse */ + #[Route(path: 'create/modal/{folderId}/{type}', requirements: ['folderId' => '\d+', 'type' => '.+'], name: 'KunstmaanMediaBundle_media_modal_create', methods: ['POST'])] public function createModalAction(Request $request, $folderId, $type) { $cKEditorFuncNum = $request->query->get('CKEditorFuncNum'); @@ -437,10 +430,9 @@ public function createModalAction(Request $request, $folderId, $type) } /** - * @Route("/bulk-move", name="KunstmaanMediaBundle_media_bulk_move") - * * @return JsonResponse|Response */ + #[Route(path: '/bulk-move', name: 'KunstmaanMediaBundle_media_bulk_move')] public function bulkMoveAction(Request $request) { $mediaRepo = $this->em->getRepository(Media::class); diff --git a/src/Kunstmaan/MediaBundle/Entity/EditableMediaWrapper.php b/src/Kunstmaan/MediaBundle/Entity/EditableMediaWrapper.php index e2b89ae28c..cd64503227 100644 --- a/src/Kunstmaan/MediaBundle/Entity/EditableMediaWrapper.php +++ b/src/Kunstmaan/MediaBundle/Entity/EditableMediaWrapper.php @@ -19,10 +19,10 @@ class EditableMediaWrapper extends AbstractEntity /** * @ORM\ManyToOne(targetEntity="Kunstmaan\MediaBundle\Entity\Media", cascade={"persist"}) * @ORM\JoinColumn(name="media_id", referencedColumnName="id") - * @Assert\NotNull() */ #[ORM\ManyToOne(targetEntity: Media::class, cascade: ['persist'])] #[ORM\JoinColumn(name: 'media_id', referencedColumnName: 'id')] + #[Assert\NotNull] private $media; /** diff --git a/src/Kunstmaan/MediaBundle/Entity/Folder.php b/src/Kunstmaan/MediaBundle/Entity/Folder.php index aa52ea34aa..fa38e037b6 100644 --- a/src/Kunstmaan/MediaBundle/Entity/Folder.php +++ b/src/Kunstmaan/MediaBundle/Entity/Folder.php @@ -42,10 +42,10 @@ class Folder extends AbstractEntity implements GedmoNode * * @Gedmo\Translatable * @ORM\Column(type="string") - * @Assert\NotBlank() */ #[ORM\Column(name: 'name', type: 'string')] #[Gedmo\Translatable] + #[Assert\NotBlank] protected $name; /** diff --git a/src/Kunstmaan/MenuBundle/Controller/MenuAdminListController.php b/src/Kunstmaan/MenuBundle/Controller/MenuAdminListController.php index 7168199b15..66429958f5 100644 --- a/src/Kunstmaan/MenuBundle/Controller/MenuAdminListController.php +++ b/src/Kunstmaan/MenuBundle/Controller/MenuAdminListController.php @@ -9,6 +9,7 @@ use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController; use Kunstmaan\MenuBundle\Service\MenuService; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; final class MenuAdminListController extends AbstractAdminListController @@ -50,10 +51,9 @@ public function getAdminListConfigurator(Request $request) } /** - * @Route("/", name="kunstmaanmenubundle_admin_menu") - * - * @return array + * @return Response */ + #[Route(path: '/', name: 'kunstmaanmenubundle_admin_menu')] public function indexAction(Request $request) { // Make sure we have a menu for each possible locale diff --git a/src/Kunstmaan/MenuBundle/Controller/MenuItemAdminListController.php b/src/Kunstmaan/MenuBundle/Controller/MenuItemAdminListController.php index e4fa862278..63af4d655c 100644 --- a/src/Kunstmaan/MenuBundle/Controller/MenuItemAdminListController.php +++ b/src/Kunstmaan/MenuBundle/Controller/MenuItemAdminListController.php @@ -57,14 +57,11 @@ public function getAdminListConfigurator(Request $request, $menuid, $entityId = } /** - * The index action - * * @param int $menuid * * @return Response - * - * @Route("/{menuid}/items", name="kunstmaanmenubundle_admin_menuitem") */ + #[Route(path: '/{menuid}/items', name: 'kunstmaanmenubundle_admin_menuitem')] public function indexAction(Request $request, $menuid) { $menuRepo = $this->em->getRepository($this->getParameter('kunstmaan_menu.entity.menu.class')); @@ -104,52 +101,40 @@ public function indexAction(Request $request, $menuid) } /** - * The add action - * - * @Route("/{menuid}/items/add", name="kunstmaanmenubundle_admin_menuitem_add", methods={"GET", "POST"}) - * - * @return array + * @return Response */ + #[Route(path: '/{menuid}/items/add', name: 'kunstmaanmenubundle_admin_menuitem_add', methods: ['GET', 'POST'])] public function addAction(Request $request, $menuid) { return parent::doAddAction($this->getAdminListConfigurator($request, $menuid), null, $request); } /** - * The edit action - * * @param int $id * - * @Route("{menuid}/items/{id}/edit", requirements={"id" = "\d+"}, name="kunstmaanmenubundle_admin_menuitem_edit", methods={"GET", "POST"}) - * - * @return array + * @return Response */ + #[Route(path: '{menuid}/items/{id}/edit', requirements: ['id' => '\d+'], name: 'kunstmaanmenubundle_admin_menuitem_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $menuid, $id) { return parent::doEditAction($this->getAdminListConfigurator($request, $menuid, $id), $id, $request); } /** - * The delete action - * * @param int $id * - * @Route("{menuid}/items/{id}/delete", requirements={"id" = "\d+"}, name="kunstmaanmenubundle_admin_menuitem_delete", methods={"GET", "POST"}) - * - * @return array + * @return Response */ + #[Route(path: '{menuid}/items/{id}/delete', requirements: ['id' => '\d+'], name: 'kunstmaanmenubundle_admin_menuitem_delete', methods: ['GET', 'POST'])] public function deleteAction(Request $request, $menuid, $id) { return parent::doDeleteAction($this->getAdminListConfigurator($request, $menuid), $id, $request); } /** - * Move an item up in the list. - * - * @Route("{menuid}/items/{item}/move-up", name="kunstmaanmenubundle_admin_menuitem_move_up", methods={"GET"}) - * * @return RedirectResponse */ + #[Route(path: '{menuid}/items/{item}/move-up', name: 'kunstmaanmenubundle_admin_menuitem_move_up', methods: ['GET'])] public function moveUpAction(Request $request, $menuid, $item) { $em = $this->getEntityManager(); @@ -166,12 +151,9 @@ public function moveUpAction(Request $request, $menuid, $item) } /** - * Move an item down in the list. - * - * @Route("{menuid}/items/{item}/move-down", name="kunstmaanmenubundle_admin_menuitem_move_down", methods={"GET"}) - * * @return RedirectResponse */ + #[Route(path: '{menuid}/items/{item}/move-down', name: 'kunstmaanmenubundle_admin_menuitem_move_down', methods: ['GET'])] public function moveDownAction(Request $request, $menuid, $item) { $em = $this->getEntityManager(); diff --git a/src/Kunstmaan/MenuBundle/Entity/BaseMenu.php b/src/Kunstmaan/MenuBundle/Entity/BaseMenu.php index 762b316b9f..cb538f03ab 100644 --- a/src/Kunstmaan/MenuBundle/Entity/BaseMenu.php +++ b/src/Kunstmaan/MenuBundle/Entity/BaseMenu.php @@ -17,20 +17,20 @@ class BaseMenu extends AbstractEntity * @var string * * @ORM\Column(name="name", type="string", length=25, nullable=true) - * @Assert\NotBlank() - * @Assert\Length(max=25) */ #[ORM\Column(name: 'name', type: 'string', length: 25, nullable: true)] + #[Assert\NotBlank] + #[Assert\Length(max: 25)] protected $name; /** * @var string * * @ORM\Column(name="locale", type="string", length=5, nullable=true) - * @Assert\NotBlank() - * @Assert\Length(max=5) */ #[ORM\Column(name: 'locale', type: 'string', length: 5, nullable: true)] + #[Assert\NotBlank] + #[Assert\Length(max: 5)] protected $locale; /** diff --git a/src/Kunstmaan/MenuBundle/Entity/BaseMenuItem.php b/src/Kunstmaan/MenuBundle/Entity/BaseMenuItem.php index c1492826cb..17d6fa7dbf 100644 --- a/src/Kunstmaan/MenuBundle/Entity/BaseMenuItem.php +++ b/src/Kunstmaan/MenuBundle/Entity/BaseMenuItem.php @@ -31,22 +31,22 @@ abstract class BaseMenuItem extends AbstractEntity * * @ORM\ManyToOne(targetEntity="Kunstmaan\MenuBundle\Entity\Menu", inversedBy="items") * @ORM\JoinColumn(name="menu_id", referencedColumnName="id") - * @Assert\NotNull() * @Gedmo\TreeRoot(identifierMethod="getMenu") */ #[ORM\ManyToOne(targetEntity: Menu::class, inversedBy: 'items')] #[ORM\JoinColumn(name: 'menu_id', referencedColumnName: 'id')] #[Gedmo\TreeRoot(identifierMethod: 'getMenu')] + #[Assert\NotNull] protected $menu; /** * @var string * * @ORM\Column(name="type", type="string", length=15, nullable=true) - * @Assert\NotBlank() - * @Assert\Length(max=15) */ #[ORM\Column(name: 'type', type: 'string', length: 15, nullable: true)] + #[Assert\NotBlank] + #[Assert\Length(max: 15)] protected $type; /** @@ -63,18 +63,18 @@ abstract class BaseMenuItem extends AbstractEntity * @var string * * @ORM\Column(name="title", type="string", nullable=true) - * @Assert\Length(max=255) */ #[ORM\Column(name: 'title', type: 'string', nullable: true)] + #[Assert\Length(max: 255)] protected $title; /** * @var string * * @ORM\Column(name="url", type="string", nullable=true) - * @Assert\Length(max=255) */ #[ORM\Column(name: 'url', type: 'string', nullable: true)] + #[Assert\Length(max: 255)] protected $url; /** @@ -339,9 +339,7 @@ public function isOnline() return false; } - /** - * @Assert\Callback - */ + #[Assert\Callback] public function validateEntity(ExecutionContextInterface $context) { if ($this->getType() == self::TYPE_PAGE_LINK && !$this->getNodeTranslation()) { diff --git a/src/Kunstmaan/MultiDomainBundle/Controller/SiteSwitchController.php b/src/Kunstmaan/MultiDomainBundle/Controller/SiteSwitchController.php index 1a6d91d848..09a93c0459 100644 --- a/src/Kunstmaan/MultiDomainBundle/Controller/SiteSwitchController.php +++ b/src/Kunstmaan/MultiDomainBundle/Controller/SiteSwitchController.php @@ -10,7 +10,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; final class SiteSwitchController { @@ -26,13 +25,9 @@ public function __construct(DomainConfigurationInterface $domainConfiguration, U } /** - * @Route("/switch-site", name="KunstmaanMultiDomainBundle_switch_site", methods={"GET"}) - * * @return Response - * - * @throws AccessDeniedException - * @throws NotFoundHttpException */ + #[Route(path: '/switch-site', name: 'KunstmaanMultiDomainBundle_switch_site', methods: ['GET'])] public function switchAction(Request $request) { $host = $request->query->get('host'); diff --git a/src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php b/src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php index 5a1072d682..640b24f26e 100644 --- a/src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php +++ b/src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php @@ -121,9 +121,7 @@ protected function init(Request $request) $this->pageCloningHelper = $this->container->get(PageCloningHelper::class); } - /** - * @Route("/", name="KunstmaanNodeBundle_nodes") - */ + #[Route(path: '/', name: 'KunstmaanNodeBundle_nodes')] public function indexAction(Request $request): Response { $this->init($request); @@ -160,19 +158,11 @@ public function indexAction(Request $request): Response } /** - * @Route( - * "/{id}/copyfromotherlanguage", - * requirements={"id" = "\d+"}, - * name="KunstmaanNodeBundle_nodes_copyfromotherlanguage", - * methods={"GET"} - * ) - * * @param int $id The node id * * @return RedirectResponse - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/copyfromotherlanguage', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_copyfromotherlanguage', methods: ['GET'])] public function copyFromOtherLanguageAction(Request $request, $id) { $this->init($request); @@ -211,19 +201,11 @@ public function copyFromOtherLanguageAction(Request $request, $id) } /** - * @Route( - * "/{id}/recopyfromotherlanguage", - * requirements={"id" = "\d+"}, - * name="KunstmaanNodeBundle_nodes_recopyfromotherlanguage", - * methods={"POST"} - * ) - * * @param int $id The node id * * @return RedirectResponse - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/recopyfromotherlanguage', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_recopyfromotherlanguage', methods: ['POST'])] public function recopyFromOtherLanguageAction(Request $request, $id) { if (!$this->isCsrfTokenValid('recopy-from-language', $request->request->get('token'))) { @@ -265,19 +247,11 @@ public function recopyFromOtherLanguageAction(Request $request, $id) } /** - * @Route( - * "/{id}/createemptypage", - * requirements={"id" = "\d+"}, - * name="KunstmaanNodeBundle_nodes_createemptypage", - * methods={"GET"} - * ) - * * @param int $id * * @return RedirectResponse - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/createemptypage', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_createemptypage', methods: ['GET'])] public function createEmptyPageAction(Request $request, $id) { $this->init($request); @@ -307,16 +281,11 @@ public function createEmptyPageAction(Request $request, $id) } /** - * @Route("/{id}/publish", requirements={"id" = - * "\d+"}, - * name="KunstmaanNodeBundle_nodes_publish", methods={"GET", "POST"}) - * * @param int $id * * @return RedirectResponse - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/publish', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_publish', methods: ['GET', 'POST'])] public function publishAction(Request $request, $id) { $this->init($request); @@ -331,19 +300,11 @@ public function publishAction(Request $request, $id) } /** - * @Route( - * "/{id}/unpublish", - * requirements={"id" = "\d+"}, - * name="KunstmaanNodeBundle_nodes_unpublish", - * methods={"GET", "POST"} - * ) - * * @param int $id * * @return RedirectResponse - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/unpublish', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_unpublish', methods: ['GET', 'POST'])] public function unPublishAction(Request $request, $id) { $this->init($request); @@ -358,19 +319,11 @@ public function unPublishAction(Request $request, $id) } /** - * @Route( - * "/{id}/unschedulepublish", - * requirements={"id" = "\d+"}, - * name="KunstmaanNodeBundle_nodes_unschedule_publish", - * methods={"GET", "POST"} - * ) - * * @param int $id * * @return RedirectResponse - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/unschedulepublish', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_unschedule_publish', methods: ['GET', 'POST'])] public function unSchedulePublishAction(Request $request, $id) { $this->init($request); @@ -390,19 +343,11 @@ public function unSchedulePublishAction(Request $request, $id) } /** - * @Route( - * "/{id}/delete", - * requirements={"id" = "\d+"}, - * name="KunstmaanNodeBundle_nodes_delete", - * methods={"POST"} - * ) - * * @param int $id * * @return RedirectResponse - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_delete', methods: ['POST'])] public function deleteAction(Request $request, $id) { $this->init($request); @@ -449,19 +394,11 @@ public function deleteAction(Request $request, $id) } /** - * @Route( - * "/{id}/duplicate", - * requirements={"id" = "\d+"}, - * name="KunstmaanNodeBundle_nodes_duplicate", - * methods={"POST"} - * ) - * * @param int $id * * @return RedirectResponse - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/duplicate', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_duplicate', methods: ['POST'])] public function duplicateAction(Request $request, $id) { if (!$this->isCsrfTokenValid('node-duplicate', $request->request->get('token'))) { @@ -522,16 +459,7 @@ public function duplicateAction(Request $request, $id) return $this->redirectToRoute('KunstmaanNodeBundle_nodes_edit', ['id' => $nodeNewPage->getId()]); } - /** - * @Route( - * "/{id}/duplicate-with-children", - * requirements={"id" = "\d+"}, - * name="KunstmaanNodeBundle_nodes_duplicate_with_children", - * methods={"POST"} - * ) - * - * @throws AccessDeniedException - */ + #[Route(path: '/{id}/duplicate-with-children', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_duplicate_with_children', methods: ['POST'])] public function duplicateWithChildrenAction(Request $request, $id) { if (!$this->isCsrfTokenValid('node-duplicate-with-children', $request->request->get('token'))) { @@ -553,21 +481,11 @@ public function duplicateWithChildrenAction(Request $request, $id) } /** - * @Route( - * "/{id}/revert", - * requirements={"id" = "\d+"}, - * defaults={"subaction" = "public"}, - * name="KunstmaanNodeBundle_nodes_revert", - * methods={"GET"} - * ) - * * @param int $id The node id * * @return RedirectResponse - * - * @throws AccessDeniedException - * @throws \InvalidArgumentException */ + #[Route(path: '/{id}/revert', requirements: ['id' => '\d+'], defaults: ['subaction' => 'public'], name: 'KunstmaanNodeBundle_nodes_revert', methods: ['GET'])] public function revertAction(Request $request, $id) { $this->init($request); @@ -633,20 +551,11 @@ public function revertAction(Request $request, $id) } /** - * @Route( - * "/{id}/add", - * requirements={"id" = "\d+"}, - * name="KunstmaanNodeBundle_nodes_add", - * methods={"POST"} - * ) - * * @param int $id * * @return RedirectResponse - * - * @throws AccessDeniedException - * @throws \InvalidArgumentException */ + #[Route(path: '/{id}/add', requirements: ['id' => '\d+'], name: 'KunstmaanNodeBundle_nodes_add', methods: ['POST'])] public function addAction(Request $request, $id) { $this->init($request); @@ -697,13 +606,9 @@ public function addAction(Request $request, $id) } /** - * @Route("/add-homepage", name="KunstmaanNodeBundle_nodes_add_homepage", methods={"POST"}) - * * @return RedirectResponse - * - * @throws AccessDeniedException - * @throws \InvalidArgumentException */ + #[Route(path: '/add-homepage', name: 'KunstmaanNodeBundle_nodes_add_homepage', methods: ['POST'])] public function addHomepageAction(Request $request) { $this->init($request); @@ -741,12 +646,9 @@ public function addHomepageAction(Request $request) } /** - * @Route("/reorder", name="KunstmaanNodeBundle_nodes_reorder", methods={"POST"}) - * * @return string - * - * @throws AccessDeniedException */ + #[Route(path: '/reorder', name: 'KunstmaanNodeBundle_nodes_reorder', methods: ['POST'])] public function reorderAction(Request $request) { $this->init($request); @@ -803,19 +705,10 @@ public function reorderAction(Request $request) } /** - * @Route( - * "/{id}/{subaction}", - * requirements={"id" = "\d+"}, - * defaults={"subaction" = "public"}, - * name="KunstmaanNodeBundle_nodes_edit", - * methods={"GET", "POST"} - * ) - * * @param int $id The node id * @param string $subaction The subaction (draft|public) - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/{subaction}', requirements: ['id' => '\d+'], defaults: ['subaction' => 'public'], name: 'KunstmaanNodeBundle_nodes_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id, $subaction): Response { $this->init($request); @@ -1022,14 +915,9 @@ public function editAction(Request $request, $id, $subaction): Response } /** - * @Route( - * "checkNodeVersionLock/{id}/{public}", - * requirements={"id" = "\d+", "public" = "(0|1)"}, - * name="KunstmaanNodeBundle_nodes_versionlock_check" - * ) - * * @return JsonResponse */ + #[Route(path: 'checkNodeVersionLock/{id}/{public}', requirements: ['id' => '\d+', 'public' => '(0|1)'], name: 'KunstmaanNodeBundle_nodes_versionlock_check')] public function checkNodeVersionLockAction(Request $request, $id, $public) { $nodeVersionIsLocked = false; diff --git a/src/Kunstmaan/NodeBundle/Controller/UrlReplaceController.php b/src/Kunstmaan/NodeBundle/Controller/UrlReplaceController.php index 30c7a92dcb..5c2107b25e 100644 --- a/src/Kunstmaan/NodeBundle/Controller/UrlReplaceController.php +++ b/src/Kunstmaan/NodeBundle/Controller/UrlReplaceController.php @@ -21,9 +21,8 @@ public function __construct(URLHelper $urlHelper) /** * Render a url with the twig url replace filter - * - * @Route("/replace", name="KunstmaanNodeBundle_urlchooser_replace", condition="request.isXmlHttpRequest()") */ + #[Route(path: '/replace', name: 'KunstmaanNodeBundle_urlchooser_replace', condition: 'request.isXmlHttpRequest()')] public function replaceURLAction(Request $request) { $response = new JsonResponse(); diff --git a/src/Kunstmaan/NodeBundle/Controller/WidgetsController.php b/src/Kunstmaan/NodeBundle/Controller/WidgetsController.php index e1164d8580..332cd4c28a 100644 --- a/src/Kunstmaan/NodeBundle/Controller/WidgetsController.php +++ b/src/Kunstmaan/NodeBundle/Controller/WidgetsController.php @@ -32,9 +32,7 @@ public function __construct(DomainConfigurationInterface $domainConfiguration, E $this->aclHelper = $aclHelper; } - /** - * @Route("/ckselecturl", name="KunstmaanNodeBundle_ckselecturl") - */ + #[Route(path: '/ckselecturl', name: 'KunstmaanNodeBundle_ckselecturl')] public function ckSelectLinkAction(Request $request): Response { $params = $this->getTemplateParameters($request); @@ -44,11 +42,7 @@ public function ckSelectLinkAction(Request $request): Response return $this->render('@KunstmaanNode/Widgets/selectLink.html.twig', $params); } - /** - * Select a link - * - * @Route("/selecturl", name="KunstmaanNodeBundle_selecturl") - */ + #[Route(path: '/selecturl', name: 'KunstmaanNodeBundle_selecturl')] public function selectLinkAction(Request $request): Response { $params = $this->getTemplateParameters($request); @@ -58,11 +52,7 @@ public function selectLinkAction(Request $request): Response return $this->render('@KunstmaanNode/Widgets/selectLink.html.twig', $params); } - /** - * Select a link - * - * @Route("/select-nodes-lazy", name="KunstmaanNodeBundle_nodes_lazy") - */ + #[Route(path: '/select-nodes-lazy', name: 'KunstmaanNodeBundle_nodes_lazy')] public function selectNodesLazy(Request $request): JsonResponse { $locale = $request->getLocale(); @@ -88,9 +78,8 @@ public function selectNodesLazy(Request $request): JsonResponse /** * Search action in url chooser popup - * - * @Route("/select-nodes-lazy_search", name="KunstmaanNodeBundle_nodes_lazy_search") */ + #[Route(path: '/select-nodes-lazy_search', name: 'KunstmaanNodeBundle_nodes_lazy_search')] public function selectNodesLazySearch(Request $request): JsonResponse { $locale = $request->getLocale(); diff --git a/src/Kunstmaan/NodeBundle/Entity/AbstractControllerAction.php b/src/Kunstmaan/NodeBundle/Entity/AbstractControllerAction.php index 1cb1ad56d4..c288028573 100644 --- a/src/Kunstmaan/NodeBundle/Entity/AbstractControllerAction.php +++ b/src/Kunstmaan/NodeBundle/Entity/AbstractControllerAction.php @@ -7,18 +7,15 @@ use Kunstmaan\NodeBundle\Form\ControllerActionAdminType; use Symfony\Component\Validator\Constraints as Assert; -/** - * AbstractControllerAction - */ abstract class AbstractControllerAction extends AbstractEntity implements HasNodeInterface { /** * @var string * * @ORM\Column(type="string") - * @Assert\NotBlank() */ #[ORM\Column(name: 'title', type: 'string')] + #[Assert\NotBlank] protected $title; /** @@ -35,8 +32,6 @@ abstract class AbstractControllerAction extends AbstractEntity implements HasNod protected $parent; /** - * Set title - * * @param string $title * * @return AbstractControllerAction @@ -49,8 +44,6 @@ public function setTitle($title) } /** - * Get title - * * @return string */ public function getTitle() diff --git a/src/Kunstmaan/NodeBundle/Entity/AbstractPage.php b/src/Kunstmaan/NodeBundle/Entity/AbstractPage.php index d0213e8e45..3f36c7f60b 100644 --- a/src/Kunstmaan/NodeBundle/Entity/AbstractPage.php +++ b/src/Kunstmaan/NodeBundle/Entity/AbstractPage.php @@ -16,19 +16,19 @@ abstract class AbstractPage extends AbstractEntity implements PageInterface * @var string * * @ORM\Column(type="string", length=255) - * @Assert\NotBlank() - * @Assert\Length(max=255) */ #[ORM\Column(name: 'title', type: 'string', length: 255)] + #[Assert\NotBlank] + #[Assert\Length(max: 255)] protected $title; /** * @var string * * @ORM\Column(type="string", nullable=true, name="page_title", length=255) - * @Assert\Length(max=255) */ #[ORM\Column(name: 'page_title', type: 'string', nullable: true, length: 255)] + #[Assert\Length(max: 255)] protected $pageTitle; /** @@ -37,8 +37,6 @@ abstract class AbstractPage extends AbstractEntity implements PageInterface protected $parent; /** - * Set title - * * @param string $title * * @return AbstractPage @@ -51,8 +49,6 @@ public function setTitle($title) } /** - * Get title - * * @return string */ public function getTitle() @@ -61,8 +57,6 @@ public function getTitle() } /** - * Set pagetitle - * * @param string $pageTitle * * @return AbstractPage @@ -75,8 +69,6 @@ public function setPageTitle($pageTitle) } /** - * Get pagetitle - * * @return string */ public function getPageTitle() diff --git a/src/Kunstmaan/NodeBundle/Entity/Node.php b/src/Kunstmaan/NodeBundle/Entity/Node.php index b0e85088b7..7d2da112cd 100644 --- a/src/Kunstmaan/NodeBundle/Entity/Node.php +++ b/src/Kunstmaan/NodeBundle/Entity/Node.php @@ -89,10 +89,10 @@ class Node extends AbstractEntity implements GedmoNode /** * @var ArrayCollection * - * @Assert\Valid() * @ORM\OneToMany(targetEntity="NodeTranslation", mappedBy="node") */ #[ORM\OneToMany(targetEntity: NodeTranslation::class, mappedBy: 'node')] + #[Assert\Valid] protected $nodeTranslations; /** diff --git a/src/Kunstmaan/NodeBundle/Entity/NodeTranslation.php b/src/Kunstmaan/NodeBundle/Entity/NodeTranslation.php index 98ec46f654..a60974a718 100644 --- a/src/Kunstmaan/NodeBundle/Entity/NodeTranslation.php +++ b/src/Kunstmaan/NodeBundle/Entity/NodeTranslation.php @@ -64,19 +64,19 @@ class NodeTranslation extends AbstractEntity * @var string * * @ORM\Column(type="string", nullable=true) - * @Assert\Regex("/^[a-zA-Z0-9\-_\/]+$/") - * @Assert\Length(max="255") */ #[ORM\Column(name: 'slug', type: 'string', nullable: true)] + #[Assert\Regex('/^[a-zA-Z0-9\-_\/]+$/')] + #[Assert\Length(max: '255')] protected $slug; /** * @var string * * @ORM\Column(type="text", nullable=true) - * @Assert\Length(max="1000") */ #[ORM\Column(name: 'url', type: 'text', nullable: true)] + #[Assert\Length(max: '1000')] protected $url; /** @@ -92,12 +92,12 @@ class NodeTranslation extends AbstractEntity /** * @var ArrayCollection * - * @Assert\Valid() * @ORM\OneToMany(targetEntity="NodeVersion", mappedBy="nodeTranslation") * @ORM\OrderBy({"created" = "ASC"}) */ #[ORM\OneToMany(targetEntity: NodeVersion::class, mappedBy: 'nodeTranslation')] #[ORM\OrderBy(['created' => 'ASC'])] + #[Assert\Valid] protected $nodeVersions; /** diff --git a/src/Kunstmaan/PagePartBundle/Controller/PagePartAdminController.php b/src/Kunstmaan/PagePartBundle/Controller/PagePartAdminController.php index 6ab96df6ef..5df54b13ae 100644 --- a/src/Kunstmaan/PagePartBundle/Controller/PagePartAdminController.php +++ b/src/Kunstmaan/PagePartBundle/Controller/PagePartAdminController.php @@ -34,9 +34,7 @@ public function __construct(EntityManagerInterface $em, PagePartConfigurationRea $this->fullContainer = $container; } - /** - * @Route("/newPagePart", name="KunstmaanPagePartBundle_admin_newpagepart") - */ + #[Route(path: '/newPagePart', name: 'KunstmaanPagePartBundle_admin_newpagepart')] public function newPagePartAction(Request $request): Response { $pageId = $request->query->get('pageid'); diff --git a/src/Kunstmaan/RedirectBundle/Controller/RedirectAdminListController.php b/src/Kunstmaan/RedirectBundle/Controller/RedirectAdminListController.php index 4caa8d4df8..bd321b2e62 100644 --- a/src/Kunstmaan/RedirectBundle/Controller/RedirectAdminListController.php +++ b/src/Kunstmaan/RedirectBundle/Controller/RedirectAdminListController.php @@ -35,64 +35,51 @@ public function getAdminListConfigurator() } /** - * The index action - * - * @Route("/", name="kunstmaanredirectbundle_admin_redirect") + * @return Response */ + #[Route(path: '/', name: 'kunstmaanredirectbundle_admin_redirect')] public function indexAction(Request $request) { return parent::doIndexAction($this->getAdminListConfigurator(), $request); } /** - * The add action - * - * @Route("/add", name="kunstmaanredirectbundle_admin_redirect_add", methods={"GET", "POST"}) - * * @return Response */ + #[Route(path: '/add', name: 'kunstmaanredirectbundle_admin_redirect_add', methods: ['GET', 'POST'])] public function addAction(Request $request) { return parent::doAddAction($this->getAdminListConfigurator(), null, $request); } /** - * The edit action - * * @param int $id * - * @Route("/{id}", requirements={"id" = "\d+"}, name="kunstmaanredirectbundle_admin_redirect_edit", methods={"GET", "POST"}) - * * @return Response */ + #[Route(path: '/{id}', requirements: ['id' => '\d+'], name: 'kunstmaanredirectbundle_admin_redirect_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id) { return parent::doEditAction($this->getAdminListConfigurator(), $id, $request); } /** - * The delete action - * * @param int $id * - * @Route("/{id}/delete", requirements={"id" = "\d+"}, name="kunstmaanredirectbundle_admin_redirect_delete", methods={"GET", "POST"}) - * * @return Response */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'kunstmaanredirectbundle_admin_redirect_delete', methods: ['GET', 'POST'])] public function deleteAction(Request $request, $id) { return parent::doDeleteAction($this->getAdminListConfigurator(), $id, $request); } /** - * The export action - * * @param string $_format * - * @Route("/export.{_format}", requirements={"_format" = "csv|xlsx|ods"}, name="kunstmaanredirectbundle_admin_redirect_export", methods={"GET", "POST"}) - * * @return Response */ + #[Route(path: '/export.{_format}', requirements: ['_format' => 'csv|xlsx|ods'], name: 'kunstmaanredirectbundle_admin_redirect_export', methods: ['GET', 'POST'])] public function exportAction(Request $request, $_format) { return parent::doExportAction($this->getAdminListConfigurator(), $_format, $request); diff --git a/src/Kunstmaan/RedirectBundle/Entity/Redirect.php b/src/Kunstmaan/RedirectBundle/Entity/Redirect.php index 22a83bc755..80d2da1e2f 100644 --- a/src/Kunstmaan/RedirectBundle/Entity/Redirect.php +++ b/src/Kunstmaan/RedirectBundle/Entity/Redirect.php @@ -17,7 +17,6 @@ * } * ) * @ORM\Entity(repositoryClass="Kunstmaan\RedirectBundle\Repository\RedirectRepository") - * @UniqueEntity(fields={"origin", "domain"}) */ #[ORM\Table(name: 'kuma_redirects')] #[ORM\UniqueConstraint(name: 'kuma_redirects_idx_domain_origin', columns: ['domain', 'origin'])] @@ -37,9 +36,9 @@ class Redirect extends AbstractEntity * @var string * * @ORM\Column(name="origin", type="string", length=255) - * @Assert\NotBlank() */ #[ORM\Column(name: 'origin', type: 'string', length: 255)] + #[Assert\NotBlank] private $origin; /** @@ -54,9 +53,9 @@ class Redirect extends AbstractEntity * @var string * * @ORM\Column(name="target", type="text") - * @Assert\NotBlank() */ #[ORM\Column(name: 'target', type: 'text')] + #[Assert\NotBlank] private $target; /** @@ -183,9 +182,7 @@ public function setNote($note) return $this; } - /** - * @Assert\Callback - */ + #[Assert\Callback] public function validate(ExecutionContextInterface $context) { if ($this->getOrigin() === $this->getTarget()) { diff --git a/src/Kunstmaan/SeoBundle/Controller/Admin/SettingsController.php b/src/Kunstmaan/SeoBundle/Controller/Admin/SettingsController.php index fc68c8543c..7fd3df097e 100644 --- a/src/Kunstmaan/SeoBundle/Controller/Admin/SettingsController.php +++ b/src/Kunstmaan/SeoBundle/Controller/Admin/SettingsController.php @@ -27,9 +27,8 @@ public function __construct(TranslatorInterface $translator, EntityManagerInterf /** * Generates the robots administration form and fills it with a default value if needed. - * - * @Route(path="/", name="KunstmaanSeoBundle_settings_robots") */ + #[Route(path: '/', name: 'KunstmaanSeoBundle_settings_robots')] public function robotsSettingsAction(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); diff --git a/src/Kunstmaan/SeoBundle/Controller/RobotsController.php b/src/Kunstmaan/SeoBundle/Controller/RobotsController.php index 75f7ac9cc4..2c67912800 100644 --- a/src/Kunstmaan/SeoBundle/Controller/RobotsController.php +++ b/src/Kunstmaan/SeoBundle/Controller/RobotsController.php @@ -24,9 +24,8 @@ public function __construct(EntityManagerInterface $em, string $robotsDefault) /** * Generates the robots.txt content when available in the database and falls back to normal robots.txt if exists - * - * @Route(path="/robots.txt", name="KunstmaanSeoBundle_robots", defaults={"_format": "txt"}) */ + #[Route(path: '/robots.txt', name: 'KunstmaanSeoBundle_robots', defaults: ['_format' => 'txt'])] public function indexAction(Request $request): Response { $entity = $this->em->getRepository(Robots::class)->findOneBy([]); diff --git a/src/Kunstmaan/SitemapBundle/Controller/SitemapController.php b/src/Kunstmaan/SitemapBundle/Controller/SitemapController.php index 6226241aed..030bef2f48 100644 --- a/src/Kunstmaan/SitemapBundle/Controller/SitemapController.php +++ b/src/Kunstmaan/SitemapBundle/Controller/SitemapController.php @@ -32,9 +32,8 @@ public function __construct(NodeMenu $nodeMenu, DomainConfigurationInterface $do * This will generate a sitemap for the specified locale. * Use the mode parameter to select in which mode the sitemap should be * generated. At this moment only XML is supported - * - * @Route("/sitemap-{locale}.{_format}", name="KunstmaanSitemapBundle_sitemap", requirements={"_format" = "xml"}) */ + #[Route(path: '/sitemap-{locale}.{_format}', name: 'KunstmaanSitemapBundle_sitemap', requirements: ['_format' => 'xml'])] public function sitemapAction($locale): Response { $nodeMenu = $this->nodeMenu; @@ -59,9 +58,8 @@ public function sitemapAction($locale): Response * https://support.google.com/webmasters/answer/75712?rd=1 Use the mode * parameter to select in which mode the sitemap should be generated. At * this moment only XML is supported - * - * @Route("/sitemap.{_format}", name="KunstmaanSitemapBundle_sitemapindex", requirements={"_format" = "xml"}) */ + #[Route(path: '/sitemap.{_format}', name: 'KunstmaanSitemapBundle_sitemapindex', requirements: ['_format' => 'xml'])] public function sitemapIndexAction(Request $request): Response { $locales = $this->domainConfiguration->getBackendLocales(); diff --git a/src/Kunstmaan/TaggingBundle/Controller/TagAdminListController.php b/src/Kunstmaan/TaggingBundle/Controller/TagAdminListController.php index c95b7f71a1..79927575da 100644 --- a/src/Kunstmaan/TaggingBundle/Controller/TagAdminListController.php +++ b/src/Kunstmaan/TaggingBundle/Controller/TagAdminListController.php @@ -37,41 +37,31 @@ public function getAdminListConfigurator() return $this->configurator; } - /** - * @Route("/", name="kunstmaantaggingbundle_admin_tag") - */ + #[Route(path: '/', name: 'kunstmaantaggingbundle_admin_tag')] public function indexAction(Request $request): Response { return parent::doIndexAction($this->getAdminListConfigurator(), $request); } - /** - * @Route("/add", name="kunstmaantaggingbundle_admin_tag_add", methods={"GET", "POST"}) - */ + #[Route(path: '/add', name: 'kunstmaantaggingbundle_admin_tag_add', methods: ['GET', 'POST'])] public function addAction(Request $request): Response { return parent::doAddAction($this->getAdminListConfigurator(), null, $request); } - /** - * @Route("/{id}/edit", requirements={"id" = "\d+"}, name="kunstmaantaggingbundle_admin_tag_edit", methods={"GET", "POST"}) - */ + #[Route(path: '/{id}/edit', requirements: ['id' => '\d+'], name: 'kunstmaantaggingbundle_admin_tag_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id): Response { return parent::doEditAction($this->getAdminListConfigurator(), $id, $request); } - /** - * @Route("/{id}/delete", requirements={"id" = "\d+"}, name="kunstmaantaggingbundle_admin_tag_delete", methods={"GET", "POST"}) - */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'kunstmaantaggingbundle_admin_tag_delete', methods: ['GET', 'POST'])] public function deleteAction(Request $request, $id): Response { return parent::doDeleteAction($this->getAdminListConfigurator(), $id, $request); } - /** - * @Route("/autocomplete.{_format}", name="kunstmaantaggingbundle_admin_tag_autocomplete", defaults={"_format" = "json"}) - */ + #[Route(path: '/autocomplete.{_format}', name: 'kunstmaantaggingbundle_admin_tag_autocomplete', defaults: ['_format' => 'json'])] public function autocompleteAction(Request $request): Response { $search = $request->query->get('term'); diff --git a/src/Kunstmaan/TaggingBundle/Entity/Tag.php b/src/Kunstmaan/TaggingBundle/Entity/Tag.php index 1d16e6fc67..c82ea03502 100644 --- a/src/Kunstmaan/TaggingBundle/Entity/Tag.php +++ b/src/Kunstmaan/TaggingBundle/Entity/Tag.php @@ -13,7 +13,6 @@ /** * @ORM\Entity(repositoryClass="Kunstmaan\TaggingBundle\Repository\TagRepository") * @ORM\Table(name="kuma_tags") - * @UniqueEntity("name") */ #[ORM\Entity(repositoryClass: TagRepository::class)] #[ORM\Table(name: 'kuma_tags')] diff --git a/src/Kunstmaan/TranslatorBundle/Controller/TranslatorCommandController.php b/src/Kunstmaan/TranslatorBundle/Controller/TranslatorCommandController.php index fabf44db6b..b2973689fc 100644 --- a/src/Kunstmaan/TranslatorBundle/Controller/TranslatorCommandController.php +++ b/src/Kunstmaan/TranslatorBundle/Controller/TranslatorCommandController.php @@ -26,9 +26,7 @@ public function __construct(ResourceCacher $resourceCacher, ImportCommandHandler $this->translator = $translator; } - /** - * @Route("/clear-cache", name="KunstmaanTranslatorBundle_command_clear_cache") - */ + #[Route(path: '/clear-cache', name: 'KunstmaanTranslatorBundle_command_clear_cache')] public function clearCacheAction() { $this->resourceCacher->flushCache(); @@ -41,9 +39,7 @@ public function clearCacheAction() return $this->redirectToRoute('KunstmaanTranslatorBundle_settings_translations'); } - /** - * @Route("/import", name="KunstmaanTranslatorBundle_command_import") - */ + #[Route(path: '/import', name: 'KunstmaanTranslatorBundle_command_import')] public function importAction() { $importCommand = new ImportCommand(); @@ -63,9 +59,7 @@ public function importAction() return $this->redirectToRoute('KunstmaanTranslatorBundle_settings_translations'); } - /** - * @Route("/import-forced", name="KunstmaanTranslatorBundle_command_import_forced") - */ + #[Route(path: '/import-forced', name: 'KunstmaanTranslatorBundle_command_import_forced')] public function importForcedAction() { $importCommand = new ImportCommand(); diff --git a/src/Kunstmaan/TranslatorBundle/Controller/TranslatorController.php b/src/Kunstmaan/TranslatorBundle/Controller/TranslatorController.php index 91b1207bf3..3f01f9e79b 100644 --- a/src/Kunstmaan/TranslatorBundle/Controller/TranslatorController.php +++ b/src/Kunstmaan/TranslatorBundle/Controller/TranslatorController.php @@ -43,9 +43,7 @@ public function __construct(CacheValidator $cacheValidator, Importer $importerSe $this->em = $em; } - /** - * @Route("/", name="KunstmaanTranslatorBundle_settings_translations") - */ + #[Route(path: '/', name: 'KunstmaanTranslatorBundle_settings_translations')] public function indexAction(Request $request): Response { $configurator = $this->getAdminListConfigurator(); @@ -74,11 +72,8 @@ public function indexAction(Request $request): Response * @param string $keyword * @param string $domain * @param string $locale - * - * @throws \Doctrine\ORM\OptimisticLockException - * - * @Route("/add", name="KunstmaanTranslatorBundle_settings_translations_add", methods={"GET", "POST"}) */ + #[Route(path: '/add', name: 'KunstmaanTranslatorBundle_settings_translations_add', methods: ['GET', 'POST'])] public function addAction(Request $request, $keyword = '', $domain = '', $locale = ''): Response { $configurator = $this->getAdminListConfigurator(); @@ -124,13 +119,7 @@ public function addAction(Request $request, $keyword = '', $domain = '', $locale ]); } - /** - * The edit action - * - * @Route("/{id}/edit", requirements={"id" = "\d+"}, name="KunstmaanTranslatorBundle_settings_translations_edit", methods={"GET", "POST"}) - * - * @throws \InvalidArgumentException - */ + #[Route(path: '/{id}/edit', requirements: ['id' => '\d+'], name: 'KunstmaanTranslatorBundle_settings_translations_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id): Response { $configurator = $this->getAdminListConfigurator(); @@ -185,9 +174,7 @@ public function editAction(Request $request, $id): Response ]); } - /** - * @Route("upload", name="KunstmaanTranslatorBundle_settings_translations_upload", methods={"GET", "POST"}) - */ + #[Route(path: 'upload', name: 'KunstmaanTranslatorBundle_settings_translations_upload', methods: ['GET', 'POST'])] public function uploadFileAction(Request $request): Response { /** @var FormBuilderInterface $uploadForm */ @@ -214,9 +201,8 @@ public function uploadFileAction(Request $request): Response /** * @param string $_format - * - * @Route("/export.{_format}", requirements={"_format" = "csv|ods|xlsx"}, name="KunstmaanTranslatorBundle_settings_translations_export", methods={"GET", "POST"}) */ + #[Route(path: '/export.{_format}', requirements: ['_format' => 'csv|ods|xlsx'], name: 'KunstmaanTranslatorBundle_settings_translations_export', methods: ['GET', 'POST'])] public function exportAction(Request $request, $_format): Response { return parent::doExportAction($this->getAdminListConfigurator(), $_format, $request); @@ -242,9 +228,7 @@ public function editSearchAction($domain, $locale, $keyword): RedirectResponse return $this->redirectToRoute($editUrl['path'], $editUrl['params']); } - /** - * @Route("/{id}/delete", requirements={"id" = "\d+"}, name="KunstmaanTranslatorBundle_settings_translations_delete", methods={"POST"}) - */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'KunstmaanTranslatorBundle_settings_translations_delete', methods: ['POST'])] public function deleteAction(Request $request, $id): RedirectResponse { $indexUrl = $this->getAdminListConfigurator()->getIndexUrl(); @@ -279,10 +263,9 @@ public function getAdminListConfigurator() } /** - * @Route("/inline-edit", name="KunstmaanTranslatorBundle_settings_translations_inline_edit", methods={"POST"}) - * * @return JsonResponse|Response */ + #[Route(path: '/inline-edit', name: 'KunstmaanTranslatorBundle_settings_translations_inline_edit', methods: ['POST'])] public function inlineEditAction(Request $request) { $values = $request->request->all(); diff --git a/src/Kunstmaan/TranslatorBundle/Entity/Translation.php b/src/Kunstmaan/TranslatorBundle/Entity/Translation.php index 4d8a487983..bf0edc139f 100644 --- a/src/Kunstmaan/TranslatorBundle/Entity/Translation.php +++ b/src/Kunstmaan/TranslatorBundle/Entity/Translation.php @@ -46,27 +46,27 @@ class Translation /** * @ORM\Column(type="integer", name="translation_id", nullable=true) - * @Assert\NotBlank() */ #[ORM\Column(name: 'translation_id', type: 'integer', nullable: true)] + #[Assert\NotBlank] protected $translationId; /** * The translations keyword to use in your template or call from the translator * * @ORM\Column(type="string", nullable=true) - * @Assert\NotBlank() */ #[ORM\Column(name: 'keyword', type: 'string', nullable: true)] + #[Assert\NotBlank] protected $keyword; /** * The translations keyword to use in your template or call from the translator * * @ORM\Column(type="string", length=5, nullable=true) - * @Assert\NotBlank() */ #[ORM\Column(name: 'locale', type: 'string', length: 5, nullable: true)] + #[Assert\NotBlank] protected $locale; /** @@ -91,17 +91,17 @@ class Translation * @var string * * @ORM\Column(type="text", nullable=true) - * @Assert\NotBlank() */ #[ORM\Column(name: 'text', type: 'text', nullable: true)] + #[Assert\NotBlank] protected $text; /** * @ORM\Column(type="string", length=60, nullable=true) - * @Assert\NotBlank() - * @Assert\Length(max=60) */ #[ORM\Column(name: 'domain', type: 'string', length: 60, nullable: true)] + #[Assert\NotBlank] + #[Assert\Length(max: 60)] protected $domain; /** diff --git a/src/Kunstmaan/TranslatorBundle/Model/TextWithLocale.php b/src/Kunstmaan/TranslatorBundle/Model/TextWithLocale.php index 8418ad8eb4..c13f99160a 100644 --- a/src/Kunstmaan/TranslatorBundle/Model/TextWithLocale.php +++ b/src/Kunstmaan/TranslatorBundle/Model/TextWithLocale.php @@ -13,9 +13,8 @@ class TextWithLocale /** * @var string - * - * @Assert\NotBlank() */ + #[Assert\NotBlank] protected $locale; /** diff --git a/src/Kunstmaan/TranslatorBundle/Model/Translation.php b/src/Kunstmaan/TranslatorBundle/Model/Translation.php index 4081818165..88857c0cf8 100644 --- a/src/Kunstmaan/TranslatorBundle/Model/Translation.php +++ b/src/Kunstmaan/TranslatorBundle/Model/Translation.php @@ -8,21 +8,15 @@ class Translation { /** - * The translation domain - * - * @Assert\NotBlank() - * * @var string */ + #[Assert\NotBlank] protected $domain; /** - * The translation keyword - * - * @Assert\NotBlank() - * * @var string */ + #[Assert\NotBlank] protected $keyword; /** diff --git a/src/Kunstmaan/UserManagementBundle/Controller/GroupsController.php b/src/Kunstmaan/UserManagementBundle/Controller/GroupsController.php index 5fd2c61e0c..c4f06392a4 100644 --- a/src/Kunstmaan/UserManagementBundle/Controller/GroupsController.php +++ b/src/Kunstmaan/UserManagementBundle/Controller/GroupsController.php @@ -14,7 +14,6 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Contracts\Translation\TranslatorInterface; /** @@ -39,11 +38,7 @@ public function __construct(TranslatorInterface $translator, AdminListFactory $a $this->slugifier = $slugifier; } - /** - * @Route("/", name="KunstmaanUserManagementBundle_settings_groups") - * - * @throws AccessDeniedException - */ + #[Route(path: '/', name: 'KunstmaanUserManagementBundle_settings_groups')] public function listAction(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -56,11 +51,7 @@ public function listAction(Request $request): Response ]); } - /** - * @Route("/add", name="KunstmaanUserManagementBundle_settings_groups_add", methods={"GET", "POST"}) - * - * @throws AccessDeniedException - */ + #[Route(path: '/add', name: 'KunstmaanUserManagementBundle_settings_groups_add', methods: ['GET', 'POST'])] public function addAction(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -92,11 +83,8 @@ public function addAction(Request $request): Response /** * @param int $id - * - * @Route("/{id}/edit", requirements={"id" = "\d+"}, name="KunstmaanUserManagementBundle_settings_groups_edit", methods={"GET", "POST"}) - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/edit', requirements: ['id' => '\d+'], name: 'KunstmaanUserManagementBundle_settings_groups_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -130,11 +118,8 @@ public function editAction(Request $request, $id): Response /** * @param int $id - * - * @Route("/{id}/delete", requirements={"id" = "\d+"}, name="KunstmaanUserManagementBundle_settings_groups_delete", methods={"POST"}) - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'KunstmaanUserManagementBundle_settings_groups_delete', methods: ['POST'])] public function deleteAction(Request $request, $id): RedirectResponse { $configurator = new GroupAdminListConfigurator($this->em); diff --git a/src/Kunstmaan/UserManagementBundle/Controller/RolesController.php b/src/Kunstmaan/UserManagementBundle/Controller/RolesController.php index cffe3093a7..593aeb7472 100644 --- a/src/Kunstmaan/UserManagementBundle/Controller/RolesController.php +++ b/src/Kunstmaan/UserManagementBundle/Controller/RolesController.php @@ -14,7 +14,6 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Contracts\Translation\TranslatorInterface; /** @@ -39,11 +38,7 @@ public function __construct(TranslatorInterface $translator, AdminListFactory $a $this->slugifier = $slugifier; } - /** - * @Route("/", name="KunstmaanUserManagementBundle_settings_roles") - * - * @throws AccessDeniedException - */ + #[Route(path: '/', name: 'KunstmaanUserManagementBundle_settings_roles')] public function listAction(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -56,11 +51,7 @@ public function listAction(Request $request): Response ]); } - /** - * @Route("/add", name="KunstmaanUserManagementBundle_settings_roles_add", methods={"GET", "POST"}) - * - * @throws AccessDeniedException - */ + #[Route(path: '/add', name: 'KunstmaanUserManagementBundle_settings_roles_add', methods: ['GET', 'POST'])] public function addAction(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -92,11 +83,8 @@ public function addAction(Request $request): Response /** * @param int $id - * - * @Route("/{id}/edit", requirements={"id" = "\d+"}, name="KunstmaanUserManagementBundle_settings_roles_edit", methods={"GET", "POST"}) - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/edit', requirements: ['id' => '\d+'], name: 'KunstmaanUserManagementBundle_settings_roles_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -130,11 +118,8 @@ public function editAction(Request $request, $id): Response /** * @param int $id - * - * @Route ("/{id}/delete", requirements={"id" = "\d+"}, name="KunstmaanUserManagementBundle_settings_roles_delete", methods={"POST"}) - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/delete', requirements: ['id' => '\d+'], name: 'KunstmaanUserManagementBundle_settings_roles_delete', methods: ['POST'])] public function deleteAction(Request $request, $id): RedirectResponse { $configurator = new RoleAdminListConfigurator($this->em); diff --git a/src/Kunstmaan/UserManagementBundle/Controller/UsersController.php b/src/Kunstmaan/UserManagementBundle/Controller/UsersController.php index dd78d73929..226684e85d 100644 --- a/src/Kunstmaan/UserManagementBundle/Controller/UsersController.php +++ b/src/Kunstmaan/UserManagementBundle/Controller/UsersController.php @@ -22,7 +22,6 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Routing\Annotation\Route; -use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use Symfony\Contracts\Translation\TranslatorInterface; @@ -60,9 +59,7 @@ public function __construct( $this->em = $em; } - /** - * @Route("/", name="KunstmaanUserManagementBundle_settings_users") - */ + #[Route(path: '/', name: 'KunstmaanUserManagementBundle_settings_users')] public function listAction(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -94,9 +91,7 @@ private function getUserClassInstance() return new $userClassName(); } - /** - * @Route("/add", name="KunstmaanUserManagementBundle_settings_users_add", methods={"GET", "POST"}) - */ + #[Route(path: '/add', name: 'KunstmaanUserManagementBundle_settings_users_add', methods: ['GET', 'POST'])] public function addAction(Request $request): Response { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); @@ -143,11 +138,8 @@ public function addAction(Request $request): Response /** * @param int $id - * - * @Route("/{id}/edit", requirements={"id" = "\d+"}, name="KunstmaanUserManagementBundle_settings_users_edit", methods={"GET", "POST"}) - * - * @throws AccessDeniedException */ + #[Route(path: '/{id}/edit', requirements: ['id' => '\d+'], name: 'KunstmaanUserManagementBundle_settings_users_edit', methods: ['GET', 'POST'])] public function editAction(Request $request, $id): Response { // The logged in user should be able to change his own password/username/email and not for other users @@ -215,9 +207,7 @@ public function editAction(Request $request, $id): Response return $this->render('@KunstmaanUserManagement/Users/edit.html.twig', $params); } - /** - * @Route("/form-delete/{id}", requirements={"id" = "\d+"}, name="KunstmaanUserManagementBundle_settings_users_form_delete", methods={"POST"}) - */ + #[Route(path: '/form-delete/{id}', requirements: ['id' => '\d+'], name: 'KunstmaanUserManagementBundle_settings_users_form_delete', methods: ['POST'])] public function deleteFormAction(Request $request, $id): RedirectResponse { $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN'); diff --git a/src/Kunstmaan/VotingBundle/Controller/VotingController.php b/src/Kunstmaan/VotingBundle/Controller/VotingController.php index 4ad4a05ee2..b8147b9e5e 100644 --- a/src/Kunstmaan/VotingBundle/Controller/VotingController.php +++ b/src/Kunstmaan/VotingBundle/Controller/VotingController.php @@ -24,9 +24,7 @@ public function __construct(EventDispatcherInterface $eventDispatcher) $this->eventDispatcher = $eventDispatcher; } - /** - * @Route("/voting-upvote", name="voting_upvote") - */ + #[Route(path: '/voting-upvote', name: 'voting_upvote')] public function upVoteAction(Request $request): Response { $reference = $request->query->get('reference'); @@ -36,9 +34,7 @@ public function upVoteAction(Request $request): Response return $this->render('@KunstmaanVoting/UpDown/voted.html.twig'); } - /** - * @Route("/voting-downvote", name="voting_downvote") - */ + #[Route(path: '/voting-downvote', name: 'voting_downvote')] public function downVoteAction(Request $request): Response { $reference = $request->query->get('reference'); @@ -48,9 +44,7 @@ public function downVoteAction(Request $request): Response return $this->render('@KunstmaanVoting/UpDown/voted.html.twig'); } - /** - * @Route("/voting-facebooklike", name="voting_facebooklike") - */ + #[Route(path: '/voting-facebooklike', name: 'voting_facebooklike')] public function facebookLikeAction(Request $request) { $response = $request->query->get('response'); @@ -58,9 +52,7 @@ public function facebookLikeAction(Request $request) $this->eventDispatcher->dispatch(new FacebookLikeEvent($request, $response, $value), Events::FACEBOOK_LIKE); } - /** - * @Route("/voting-facebooksend", name="voting_facebooksend") - */ + #[Route(path: '/voting-facebooksend', name: 'voting_facebooksend')] public function facebookSendAction(Request $request) { $response = $request->query->get('response'); @@ -68,9 +60,7 @@ public function facebookSendAction(Request $request) $this->eventDispatcher->dispatch(new FacebookSendEvent($request, $response, $value), Events::FACEBOOK_SEND); } - /** - * @Route("/voting-linkedinshare", name="voting_linkedinshare") - */ + #[Route(path: '/voting-linkedinshare', name: 'voting_linkedinshare')] public function linkedInShareAction(Request $request) { $reference = $request->query->get('reference');