Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| ApiKeyController | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __invoke | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Controller; |
| 4 | |
| 5 | use App\Application\UseCase\CreateApiKeyInterface; |
| 6 | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
| 7 | use Symfony\Component\HttpFoundation\JsonResponse; |
| 8 | use Symfony\Component\HttpFoundation\Response; |
| 9 | use Symfony\Component\Routing\Attribute\Route; |
| 10 | |
| 11 | /** |
| 12 | * @author Wilhelm Zwertvaegher |
| 13 | */ |
| 14 | #[Route('/api/key')] |
| 15 | class ApiKeyController extends AbstractController |
| 16 | { |
| 17 | public function __construct(private readonly CreateApiKeyInterface $createApiKey) |
| 18 | { |
| 19 | } |
| 20 | |
| 21 | #[Route('', name: 'api_key', methods: ['POST'])] |
| 22 | public function __invoke(): JsonResponse |
| 23 | { |
| 24 | return new JsonResponse(($this->createApiKey)(), Response::HTTP_CREATED); |
| 25 | } |
| 26 | } |