Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
SetController
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 searchSet
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace App\CollectionManagement\Infrastructure\Controller;
4
5use App\CollectionManagement\Application\Command\SearchSetQuery;
6use App\CollectionManagement\Application\Handler\SearchSetHandler;
7use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
8use Symfony\Component\HttpFoundation\JsonResponse;
9use Symfony\Component\HttpFoundation\Request;
10use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
11use Symfony\Component\Routing\Attribute\Route;
12
13#[Route('/api')]
14final 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}

Paths

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.

SetController->__construct
16    public function __construct(
17        private readonly SearchSetHandler $searchSetHandler
18    )
19    {}
SetController->searchSet
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    }
{main}
3namespace App\CollectionManagement\Infrastructure\Controller;
4
5use App\CollectionManagement\Application\Command\SearchSetQuery;
6use App\CollectionManagement\Application\Handler\SearchSetHandler;
7use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
8use Symfony\Component\HttpFoundation\JsonResponse;
9use Symfony\Component\HttpFoundation\Request;
10use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
11use Symfony\Component\Routing\Attribute\Route;
12
13#[Route('/api')]
14final 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    }