From 5727e87f5d76d7810d8214ad0bfffe38c8bc2ece Mon Sep 17 00:00:00 2001 From: "a.shamavov" <a.shamavov@iqdev.digital> Date: Fri, 12 Apr 2024 18:26:35 +0500 Subject: [PATCH] refactoring --- src/Action/Functions.php | 2 ++ src/Controller/HomeController.php | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Action/Functions.php b/src/Action/Functions.php index 52d0549..ce09705 100644 --- a/src/Action/Functions.php +++ b/src/Action/Functions.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace App\Action; +use DateTimeImmutable; + class Functions { /** diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php index b8e0ce5..b97e756 100644 --- a/src/Controller/HomeController.php +++ b/src/Controller/HomeController.php @@ -4,6 +4,7 @@ namespace App\Controller; use App\Action\Functions; use App\Validation\ArrayValidation; +use DateTimeImmutable; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; @@ -41,7 +42,7 @@ class HomeController extends AbstractController return $this->json($result); } - #[Route('/func3', name: 'home', methods: ['POST'])] + #[Route('/func3', name: 'func3', methods: ['POST'])] public function home(Request $request): Response { $array = $request->get('arr'); @@ -49,7 +50,7 @@ class HomeController extends AbstractController return $this->json($result); } - #[Route('/func4', name: 'home', methods: ['POST'])] + #[Route('/func4', name: 'func4', methods: ['POST'])] public function func4(Request $request): Response { $array = $request->get('arr'); @@ -60,8 +61,8 @@ class HomeController extends AbstractController return $this->json($result); } - #[Route('/{day}/{month}/{year}', name: 'home')] - public function home(int $day, int $month, int $year): Response + #[Route('/func5/{day}/{month}/{year}', name: 'func5')] + public function func5(int $day, int $month, int $year): Response { $dateAsString = $year . "-" . $month . "-" . $day; try { -- GitLab