Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 13, 2021
1 parent 1a01383 commit ee073bb
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 36 deletions.
3 changes: 2 additions & 1 deletion packages/blog/src/Controller/BlogController.php
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Website\Blog\Controller;

use Rector\Website\Blog\Repository\PostRepository;
use Rector\Website\ValueObject\Routing\RouteName;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -16,7 +17,7 @@ public function __construct(
) {
}

#[Route('blog', name: \Rector\Website\ValueObject\Routing\RouteName::BLOG)]
#[Route('blog', name: RouteName::BLOG)]
public function __invoke(): Response
{
return $this->render('blog/blog.twig', [
Expand Down
3 changes: 2 additions & 1 deletion packages/blog/src/Controller/PostController.php
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Website\Blog\Controller;

use Rector\Website\Blog\Repository\PostRepository;
use Rector\Website\ValueObject\Routing\RouteName;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -16,7 +17,7 @@ public function __construct(
) {
}

#[Route('blog/{postSlug}', name: \Rector\Website\ValueObject\Routing\RouteName::POST, requirements: [
#[Route('blog/{postSlug}', name: RouteName::POST, requirements: [
'postSlug' => '.+',
])]
public function __invoke(string $postSlug): Response
Expand Down
3 changes: 2 additions & 1 deletion packages/blog/src/Controller/RssController.php
Expand Up @@ -7,6 +7,7 @@
use DateTimeInterface;
use Rector\Website\Blog\Repository\PostRepository;
use Rector\Website\Blog\ValueObject\Post;
use Rector\Website\ValueObject\Routing\RouteName;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -18,7 +19,7 @@ public function __construct(
) {
}

#[Route('rss.xml', name: \Rector\Website\ValueObject\Routing\RouteName::RSS)]
#[Route('rss.xml', name: RouteName::RSS)]
public function __invoke(): Response
{
$posts = $this->postRepository->getPosts();
Expand Down
3 changes: 2 additions & 1 deletion src/Controller/HomepageController.php
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Website\Controller;

use Rector\Website\Blog\Repository\PostRepository;
use Rector\Website\ValueObject\Routing\RouteName;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
Expand All @@ -16,7 +17,7 @@ public function __construct(
) {
}

#[Route(path: '/', name: \Rector\Website\ValueObject\Routing\RouteName::HOMEPAGE)]
#[Route(path: '/', name: RouteName::HOMEPAGE)]
public function __invoke(): Response
{
return $this->render('homepage/homepage.twig', [
Expand Down
3 changes: 2 additions & 1 deletion src/Controller/MissionController.php
Expand Up @@ -4,13 +4,14 @@

namespace Rector\Website\Controller;

use Rector\Website\ValueObject\Routing\RouteName;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

final class MissionController extends AbstractController
{
#[Route(path: 'mission', name: \Rector\Website\ValueObject\Routing\RouteName::MISSION)]
#[Route(path: 'mission', name: RouteName::MISSION)]
public function __invoke(): Response
{
return $this->render('homepage/mission.twig');
Expand Down
3 changes: 2 additions & 1 deletion src/Controller/RssController.php
Expand Up @@ -4,13 +4,14 @@

namespace Rector\Website\Controller;

use Rector\Website\ValueObject\Routing\RouteName;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

final class RssController extends AbstractController
{
#[Route(path: 'rss.xml', name: \Rector\Website\ValueObject\Routing\RouteName::RSS)]
#[Route(path: 'rss.xml', name: RouteName::RSS)]
public function __invoke(): Response
{
return $this->render('homepage/rss.twig');
Expand Down
31 changes: 1 addition & 30 deletions src/ValueObject/Routing/RouteName.php
Expand Up @@ -2,37 +2,8 @@

declare(strict_types=1);

namespace Rector\Website\ValueObject\Routing;
namespace App\ValueObject\Routing;

final class RouteName
{
/**
* @var string
*/
public const BANK_DETAILS = 'bank_details';

/**
* @var string
*/
public const HOMEPAGE = 'homepage';

/**
* @var string
*/
public const MISSION = 'mission';

/**
* @var string
*/
public const BLOG = 'blog';

/**
* @var string
*/
public const POST = 'post';

/**
* @var string
*/
public const RSS = 'rss';
}

0 comments on commit ee073bb

Please sign in to comment.