Passed
Push — develop ( e3219b...3a1d34 )
by Laurent
01:38
created

GetCompany   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the G.L.S.R. Apps package.
7
 *
8
 * (c) Dev-Int Création <[email protected]>.
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Company\UI\Controller\Company;
15
16
use Company\Application\Company\DTO\OutputCompany;
17
use Company\Application\Company\Query\GetCompany as GetCompanyQuery;
18
use Core\Controller\AbstractController;
19
use Core\Domain\Common\Model\VO\ResourceUuid;
20
use Core\Domain\Common\Query\QueryInterface;
21
use Symfony\Component\HttpFoundation\Response;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\HttpFoundation\Response was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
22
23
class GetCompany extends AbstractController
24
{
25
    public function __invoke(string $uuid): Response
26
    {
27
        /** @var QueryInterface $query */
28
        $query = new GetCompanyQuery(ResourceUuid::fromString($uuid));
29
        /** @var OutputCompany $company */
30
        $company = $this->handle($query);
31
32
        return $this->response($this->serialize($company));
33
    }
34
}
35