Skip to content

Commit

Permalink
Reverted completely switching from annotation routes
Browse files Browse the repository at this point in the history
  • Loading branch information
evertharmeling committed Dec 13, 2023
1 parent eeae3dd commit 7a36acf
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 77 deletions.
29 changes: 3 additions & 26 deletions tests/Integration/config/5.4/routes/controllers.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
archive:
path: /archive
controller: Presta\SitemapBundle\Tests\Integration\Controller\ArchivesController::archive

blog_read:
path: /blog
controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::read
options:
sitemap:
section: blog

blog_post:
path: /blog/{slug}
controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::post

dispatch_message:
path: /dispatch-message
controller: Presta\SitemapBundle\Tests\Integration\Controller\MessengerController::dispatch

home:
path: /
controller: Presta\SitemapBundle\Tests\Integration\Controller\StaticController::home
options:
sitemap:
section: static

controllers:
resource: ../../../src/Controller/
type: annotation
2 changes: 2 additions & 0 deletions tests/Integration/config/5.4/special/annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
framework:
annotations: true
28 changes: 3 additions & 25 deletions tests/Integration/config/6.1/routes/controllers.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
archive:
path: /archive
controller: Presta\SitemapBundle\Tests\Integration\Controller\ArchivesController::archive

blog_read:
path: /blog
controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::read
options:
sitemap:
section: blog

blog_post:
path: /blog/{slug}
controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::post

dispatch_message:
path: /dispatch-message
controller: Presta\SitemapBundle\Tests\Integration\Controller\MessengerController::dispatch

home:
path: /
controller: Presta\SitemapBundle\Tests\Integration\Controller\StaticController::home
options:
sitemap:
section: static
controllers:
resource: ../../../src/Controller/
type: annotation
29 changes: 3 additions & 26 deletions tests/Integration/config/6.3/routes/controllers.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
archive:
path: /archive
controller: Presta\SitemapBundle\Tests\Integration\Controller\ArchivesController::archive

blog_read:
path: /blog
controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::read
options:
sitemap:
section: blog

blog_post:
path: /blog/{slug}
controller: Presta\SitemapBundle\Tests\Integration\Controller\BlogController::post

dispatch_message:
path: /dispatch-message
controller: Presta\SitemapBundle\Tests\Integration\Controller\MessengerController::dispatch

home:
path: /
controller: Presta\SitemapBundle\Tests\Integration\Controller\StaticController::home
options:
sitemap:
section: static

controllers:
resource: ../../../src/Controller/
type: annotation
3 changes: 3 additions & 0 deletions tests/Integration/src/Controller/ArchivesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

final class ArchivesController
{
/**
* @Route("/archive", name="archive")
*/
#[Route(path: '/archive', name: 'archive')]
public function archive(): Response
{
Expand Down
6 changes: 6 additions & 0 deletions tests/Integration/src/Controller/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@

final class BlogController
{
/**
* @Route("/blog", name="blog_read", options={"sitemap"={"section"="blog"}})
*/
#[Route(path: '/blog', name: 'blog_read', options: ['sitemap' => ['section' => 'blog']])]
public function read(): Response
{
return new Response(__FUNCTION__);
}

/**
* @Route("/blog/{slug}", name="blog_post")
*/
#[Route(path: '/blog/{slug}', name: 'blog_post')]
public function post(string $slug): Response
{
Expand Down
3 changes: 3 additions & 0 deletions tests/Integration/src/Controller/MessengerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

final class MessengerController
{
/**
* @Route("/dispatch-message", name="dispatch_message")
*/
#[Route(path: '/dispatch-message', name: 'dispatch_message')]
public function dispatch(Request $request, MessageBusInterface $bus): Response
{
Expand Down
3 changes: 3 additions & 0 deletions tests/Integration/src/Controller/StaticController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

final class StaticController
{
/**
* @Route("", name="home", options={"sitemap"={"section"="static"}})
*/
#[Route(path: '', name: 'home', options: ['sitemap' => ['section' => 'static']])]
public function home(): Response
{
Expand Down
3 changes: 3 additions & 0 deletions tests/Integration/src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ private function configureContainer(
$version = sprintf('%s.%s', BaseKernel::MAJOR_VERSION, BaseKernel::MINOR_VERSION);
$container->import('../config/' . $version . '/*.yaml');
$container->import('../config/services.yaml');
if (\PHP_VERSION_ID < 80000) {
$container->import('../config/' . $version . '/special/annotations.yaml');
}
}

private function configureRoutes(RoutingConfigurator $routes): void
Expand Down

0 comments on commit 7a36acf

Please sign in to comment.