diff --git a/src/Action/Functions.php b/src/Action/Functions.php index 52d054923fba0db9ce61f6c97b473292fb744217..ce09705d5ea2900aa055d587407fba5e027fd2a0 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 b8e0ce55a65063a90b421f86c0326a24fa61525a..b97e756a560b1dcdf98dd91046c146d3d822e23c 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 {