Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| TemplateStrings | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __invoke | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Controller\Contracts; |
| 6 | |
| 7 | use App\Controller\BaseController; |
| 8 | use App\Service\ContractTemplateHelper; |
| 9 | use Symfony\Component\HttpFoundation\JsonResponse; |
| 10 | use Symfony\Component\Routing\Attribute\Route; |
| 11 | use Symfony\Component\Security\Http\Attribute\IsGranted; |
| 12 | |
| 13 | #[IsGranted('ROLE_ADMIN')] |
| 14 | #[Route(path: '/contracts/template-strings', name: 'contracts_template_strings', methods: ['GET'])] |
| 15 | class TemplateStrings extends BaseController |
| 16 | { |
| 17 | public function __construct(private readonly ContractTemplateHelper $templateHelper) {} |
| 18 | |
| 19 | public function __invoke(): JsonResponse |
| 20 | { |
| 21 | return $this->json($this->templateHelper->getReplacementStrings()); |
| 22 | } |
| 23 | } |