Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 4 |
|
0.00% |
0 / 3 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| SetController | |
0.00% |
0 / 5 |
|
0.00% |
0 / 4 |
|
0.00% |
0 / 3 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| searchSet | |
0.00% |
0 / 4 |
|
0.00% |
0 / 3 |
|
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\CollectionManagement\Infrastructure\Controller; |
| 4 | |
| 5 | use App\CollectionManagement\Application\Command\SearchSetQuery; |
| 6 | use App\CollectionManagement\Application\Handler\SearchSetHandler; |
| 7 | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
| 8 | use Symfony\Component\HttpFoundation\JsonResponse; |
| 9 | use Symfony\Component\HttpFoundation\Request; |
| 10 | use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; |
| 11 | use Symfony\Component\Routing\Attribute\Route; |
| 12 | |
| 13 | #[Route('/api')] |
| 14 | final class SetController extends AbstractController |
| 15 | { |
| 16 | public function __construct( |
| 17 | private readonly SearchSetHandler $searchSetHandler |
| 18 | ) |
| 19 | {} |
| 20 | |
| 21 | #[Route('/sets', methods: ['GET', 'HEAD'])] |
| 22 | public function searchSet(Request $request): JsonResponse |
| 23 | { |
| 24 | if(!$request->query->has('q')) { |
| 25 | throw new BadRequestHttpException(); |
| 26 | } |
| 27 | $query = new SearchSetQuery($request->get('q')); |
| 28 | return $this->json(($this->searchSetHandler)($query)); |
| 29 | } |
| 30 | } |
Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not
necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once.
Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement
always has an else as part of its logical flow even if you didn't write one.
| 16 | public function __construct( |
| 17 | private readonly SearchSetHandler $searchSetHandler |
| 18 | ) |
| 19 | {} |
| 22 | public function searchSet(Request $request): JsonResponse |
| 23 | { |
| 24 | if(!$request->query->has('q')) { |
| 25 | throw new BadRequestHttpException(); |
| 22 | public function searchSet(Request $request): JsonResponse |
| 23 | { |
| 24 | if(!$request->query->has('q')) { |
| 27 | $query = new SearchSetQuery($request->get('q')); |
| 28 | return $this->json(($this->searchSetHandler)($query)); |
| 29 | } |
| 3 | namespace App\CollectionManagement\Infrastructure\Controller; |
| 4 | |
| 5 | use App\CollectionManagement\Application\Command\SearchSetQuery; |
| 6 | use App\CollectionManagement\Application\Handler\SearchSetHandler; |
| 7 | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
| 8 | use Symfony\Component\HttpFoundation\JsonResponse; |
| 9 | use Symfony\Component\HttpFoundation\Request; |
| 10 | use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; |
| 11 | use Symfony\Component\Routing\Attribute\Route; |
| 12 | |
| 13 | #[Route('/api')] |
| 14 | final class SetController extends AbstractController |
| 15 | { |
| 16 | public function __construct( |
| 17 | private readonly SearchSetHandler $searchSetHandler |
| 18 | ) |
| 19 | {} |
| 20 | |
| 21 | #[Route('/sets', methods: ['GET', 'HEAD'])] |
| 22 | public function searchSet(Request $request): JsonResponse |
| 23 | { |
| 24 | if(!$request->query->has('q')) { |
| 25 | throw new BadRequestHttpException(); |
| 26 | } |
| 27 | $query = new SearchSetQuery($request->get('q')); |
| 28 | return $this->json(($this->searchSetHandler)($query)); |
| 29 | } |