Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| Index | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __invoke | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Controller\Stores; |
| 6 | |
| 7 | use App\Controller\BaseController; |
| 8 | use App\Repository\StoreRepository; |
| 9 | use Symfony\Component\HttpFoundation\Response; |
| 10 | use Symfony\Component\Routing\Attribute\Route; |
| 11 | use Symfony\Component\Security\Http\Attribute\IsGranted; |
| 12 | |
| 13 | #[IsGranted('ROLE_CASHIER')] |
| 14 | #[Route(path: '/stores', name: 'stores_index', methods: ['GET'])] |
| 15 | class Index extends BaseController |
| 16 | { |
| 17 | public function __construct(private readonly StoreRepository $storeRepository) {} |
| 18 | |
| 19 | public function __invoke(): Response |
| 20 | { |
| 21 | return $this->render( |
| 22 | 'stores/list.html.twig', |
| 23 | [ |
| 24 | 'stores' => $this->storeRepository->findAll(), |
| 25 | ] |
| 26 | ); |
| 27 | } |
| 28 | } |