Skip to content

Commit

Permalink
Fix routing deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny van Wijk committed Apr 5, 2024
1 parent 6ed36a5 commit c9938a0
Show file tree
Hide file tree
Showing 72 changed files with 98 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

final class ForcedChangePasswordController extends AbstractController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Kunstmaan\AdminBundle\Service\UserManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Core\Exception\UserNotFoundException;

final class PasswordResetController extends AbstractController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Kunstmaan\AdminBundle\Controller\Authentication;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
use Twig\Environment;

Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/AdminBundle/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Contracts\Translation\TranslatorInterface;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

final class ExceptionController extends AbstractAdminListController
{
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/AdminBundle/Controller/ModulesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

final class ModulesController extends AbstractController
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

final class SettingsController extends AbstractController
{
Expand Down
14 changes: 7 additions & 7 deletions src/Kunstmaan/AdminBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
KunstmaanAdminBundle_default:
resource: '@KunstmaanAdminBundle/Controller/DefaultController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%

KunstmaanAdminBundle_modules:
resource: '@KunstmaanAdminBundle/Controller/ModulesController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%/modules

KunstmaanAdminBundle_settings:
resource: '@KunstmaanAdminBundle/Controller/SettingsController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%/settings

KunstmaanAdminBundle_settings_exception:
resource: '@KunstmaanAdminBundle/Controller/ExceptionController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%/settings/exception

KunstmaanAdminBundle_security:
resource: '@KunstmaanAdminBundle/Controller/Authentication/SecurityController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%

KunstmaanAdminBundle_resetting:
resource: '@KunstmaanAdminBundle/Controller/Authentication/PasswordResetController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%

KunstmaanAdminBundle_change_password:
resource: '@KunstmaanAdminBundle/Controller/Authentication/ForcedChangePasswordController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Contracts\Translation\TranslatorInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/AdminListBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kunstmaan_entity_lock_check:
resource: '@KunstmaanAdminListBundle/Controller/EntityLockCheckController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%/entity/lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ use Your\Bundle\Form\DocumentType;
use Your\Bundle\AdminList\DocumentAdminListConfigurator;
use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class DocumentAdminController extends AbstractAdminListController
Expand Down Expand Up @@ -295,7 +295,7 @@ Add the following lines to your routing.yml.
```YAML
YourBundle_documents:
resource: "@YourBundle/Controller/DocumentAdminController.php"
type: annotation
type: attribute
prefix: /{_locale}/%kunstmaan_admin.admin_prefix%/documents
requirements:
_locale: "%requiredlocales%"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Manually

Below you will find a how-to how to create an admin list based on existing page type.
Below you will find a how-to how to create an admin list based on existing page type.
You will need to create 2 classes. A pageAdminListConfigurator and a pageAdminstListController. Let's assume you allready created a page type named 'project'.

#### Classes
Expand Down Expand Up @@ -48,7 +48,7 @@ class ProjectPageAdminListConfigurator extends AbstractPageAdminListConfigurator

##### Controller

The controller will allow you to list yourpage.
The controller will allow you to list yourpage.

Create your ProjectPageAdminListController in your Controller folder and let it extend from a the AdminListController. Only the indexAction is used here.

Expand All @@ -60,7 +60,7 @@ namespace YourProject\WebsiteBundle\Controller;
use YourProject\WebsiteBundle\AdminList\ProjectPageAdminListConfigurator;
use Kunstmaan\AdminListBundle\AdminList\Configurator\AdminListConfiguratorInterface;
use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\HttpFoundation\Request;

/**
Expand Down Expand Up @@ -107,11 +107,11 @@ Add the following lines to your routing.yml.
```YAML
YourBundle_documents:
resource: '@YourBundle/Controller/ProjectPageAdminListController.php'
type: annotation
type: attribute
prefix: /{_locale}/admin/projectpage/
requirements:
_locale: "%requiredlocales%"

```

### Hiding the sidebar
Expand All @@ -133,9 +133,9 @@ use Kunstmaan\PagePartBundle\Helper\HasPageTemplateInterface;
* @ORM\Entity
*/
class ProjectPage extends \Kunstmaan\NodeBundle\Entity\AbstractPage
implements HasPageTemplateInterface ,HideSidebarInNodeEditInterface
implements HasPageTemplateInterface ,HideSidebarInNodeEditInterface
{


```

Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/CacheBundle/Controller/VarnishController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;

final class VarnishController extends AbstractController
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/CacheBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################ VARNISH ################
kunstmaancachebundle_varnish:
resource: "@KunstmaanCacheBundle/Controller/VarnishController.php"
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Kunstmaan\CookieBundle\AdminList\CookieAdminListConfigurator;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

final class CookieAdminListController extends AbstractAdminListController
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

final class CookieMenuController extends AbstractController
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

/**
* Class CookieTypeAdminListController
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/CookieBundle/Controller/LegalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

final class LegalController extends AbstractController
{
Expand Down
8 changes: 4 additions & 4 deletions src/Kunstmaan/CookieBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
kunstmaancookiebundle_cookies_menu:
resource: "@KunstmaanCookieBundle/Controller/CookieMenuController.php"
type: annotation
type: attribute
prefix: /cookies-menu/

kunstmaancookiebundle_legal:
resource: "@KunstmaanCookieBundle/Controller/LegalController.php"
type: annotation
type: attribute
prefix: /legal/

kunstmaancookiebundle_cookietype_admin_list:
resource: '@KunstmaanCookieBundle/Controller/CookieTypeAdminListController.php'
type: annotation
type: attribute
prefix: /admin/cookietype/

kunstmaancookiebundle_cookie_admin_list:
resource: '@KunstmaanCookieBundle/Controller/CookieAdminListController.php'
type: annotation
type: attribute
prefix: /admin/cookie/
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

final class DashboardController extends AbstractController
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Contracts\Translation\TranslatorInterface;

final class GoogleAnalyticsAJAXController extends AbstractController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

final class GoogleAnalyticsController extends AbstractController
Expand Down
6 changes: 3 additions & 3 deletions src/Kunstmaan/DashboardBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
kunstmaan_dashboard:
resource: '@KunstmaanDashboardBundle/Controller/DashboardController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%/dashboard

kunstmaan_dashboard_googleanalytics:
resource: '@KunstmaanDashboardBundle/Controller/GoogleAnalyticsController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%/dashboard/widget/googleanalytics

kunstmaan_dashboard_googleanalytics_AJAX:
resource: '@KunstmaanDashboardBundle/Controller/GoogleAnalyticsAJAXController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%/dashboard/ajax/
2 changes: 1 addition & 1 deletion src/Kunstmaan/DashboardBundle/Widget/DashboardWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Kunstmaan\DashboardBundle\Widget;

use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

class DashboardWidget
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Contracts\Translation\TranslatorInterface;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/FormBundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KunstmaanFormBundle_formsubmissions:
resource: '@KunstmaanFormBundle/Controller/FormSubmissionsController.php'
type: annotation
type: attribute
prefix: /%kunstmaan_admin.admin_prefix%/formsubmissions
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use {{ namespace }}\AdminList\{{ entity_class }}AdminListConfigurator;
use Kunstmaan\AdminListBundle\AdminList\Configurator\AdminListConfiguratorInterface;
use Kunstmaan\AdminListBundle\Controller\AbstractAdminListController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Kunstmaan\ArticleBundle\Controller\AbstractArticleAuthorAdminListController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

{% if canUseAttributes %}
#[Route('/{_locale}/%kunstmaan_admin.admin_prefix%/{{ entity_class|lower}}-author', requirements: ['_locale' => '%requiredlocales%'])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Kunstmaan\ArticleBundle\Controller\AbstractArticleCategoryAdminListController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

{% if canUseAttributes %}
#[Route('/{_locale}/%kunstmaan_admin.admin_prefix%/{{ entity_class|lower}}-category', requirements: ['_locale' => '%requiredlocales%'])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Kunstmaan\ArticleBundle\Controller\AbstractArticlePageAdminListController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

{% if canUseAttributes %}
#[Route('/{_locale}/%kunstmaan_admin.admin_prefix%/{{ entity_class|lower}}-page', requirements: ['_locale' => '%requiredlocales%'])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Kunstmaan\ArticleBundle\Controller\AbstractArticleTagAdminListController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

{% if canUseAttributes %}
#[Route('/{_locale}/%kunstmaan_admin.admin_prefix%/{{ entity_class|lower}}-tag', requirements: ['_locale' => '%requiredlocales%'])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

{% if canUseAttributes %}#[Route('/{_locale}/%kunstmaan_admin.admin_prefix%/bike', requirements: ['_locale' => '%requiredlocales%'])]
{% else %}/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Attribute\Route;

class DefaultController extends AbstractController
{
Expand Down
Loading

0 comments on commit c9938a0

Please sign in to comment.