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 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace App\Controller\AgentStat; | |
| 6 | ||
| 7 | use App\Controller\BaseController; | |
| 8 | use App\Enum\UserRole; | |
| 9 | use App\Repository\AgentStatRepository; | |
| 10 | use Symfony\Component\HttpFoundation\Response; | |
| 11 | use Symfony\Component\Routing\Attribute\Route; | |
| 12 | use Symfony\Component\Security\Http\Attribute\IsGranted; | |
| 13 | ||
| 14 | #[Route('/agent-stats', name: 'app_agent_stat_index', methods: ['GET'])] | |
| 15 | #[IsGranted(UserRole::USER->value)] | |
| 16 | final 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 | } |