Commit c6ab1ce2 authored by Адлан Шамавов's avatar Адлан Шамавов
Browse files

refactoring

parent bd55bad2
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ use App\Validation\{ArrayValidation, DateValidation};
use DateTimeImmutable;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Attribute\Route;

@@ -87,7 +88,7 @@ class HomeController extends AbstractController
        return $this->json($fridays);
    }

    #[Route('/func7/{startDate}/{endDate}', name: 'home')] // 01-01-2024
    #[Route('/func7/{startDate}/{endDate}', name: 'func7')] // 01-01-2024
    public function func7(string $startDate, string $endDate): Response
    {
        if (DateValidation::validate($startDate) && DateValidation::validate($endDate)) {
@@ -104,8 +105,8 @@ class HomeController extends AbstractController
        return new Response("Invalid date format");
    }

    #[Route('/{fileName}', name: 'home')]
    public function home(string $fileName): Response // text.txt
    #[Route('/func8/{fileName}', name: 'func8')]
    public function func8(string $fileName): Response // text.txt
    {
        $filePath = $this->getParameter('kernel.project_dir') . "/public/files/";
        $text = $this->functions->readLogFile($filePath . $fileName);