Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
FrontendController
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 quote
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2// src/Controller/FrontendController.php
3
4declare(strict_types=1);
5
6namespace App\Controller;
7
8use App\Repository\QuotesRepository;
9use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
10use Symfony\Component\HttpFoundation\Response;
11use Symfony\Component\Routing\Annotation\Route;
12
13/**
14 *
15 */
16class FrontendController extends AbstractController
17{
18    #[Route(path: '/', name: 'app_main')]
19    public function quote(QuotesRepository $quotesRepository): Response
20    {
21        $user = $this->getUser();
22        $quote = $quotesRepository->findOneRandom();
23
24        return $this->render(view: '@default/base.html.twig', parameters: [
25            'user' => $user,
26            'quote' => $quote->getQuote()
27        ]);
28    }
29}