Lines 100.00% 3 / 3
Functions and Methods 100.00% 1 / 1
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
Index 100.00% 3 / 3 100.00% 1 / 1 1 100.00% 1 / 1
 __invoke 100.00% 3 / 3 100.00% 1 / 1 1
1<?php
2
3declare(strict_types=1);
4
5namespace App\Controller\AgentStat;
6
7use App\Controller\BaseController;
8use App\Enum\UserRole;
9use App\Repository\AgentStatRepository;
10use Symfony\Component\HttpFoundation\Response;
11use Symfony\Component\Routing\Attribute\Route;
12use Symfony\Component\Security\Http\Attribute\IsGranted;
13
14#[Route('/agent-stats', name: 'app_agent_stat_index', methods: ['GET'])]
15#[IsGranted(UserRole::USER->value)]
16final class Index extends BaseController
17{
18    public function __invoke(AgentStatRepository $agentStatRepository): Response
19    {
20        return $this->render('agent_stat/index.html.twig', [
21            'agent_stats' => $agentStatRepository->findByOwner($this->getUser()),
22        ]);
23    }
24}