LanguagesAction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 16
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 6 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Crossword\Features\Languages;
6
7
use App\Crossword\Features\Languages\Response\Error\ErrorFactory;
8
use App\Crossword\Features\Languages\Response\FailedApiResponse;
9
use App\Crossword\Features\Languages\Response\ResponseInterface;
10
use App\Crossword\Features\Languages\Response\SuccessApiResponse;
11
use Doctrine\Common\Annotations\Annotation\IgnoreAnnotation;
0 ignored issues
show
Bug introduced by
The type Doctrine\Common\Annotati...tation\IgnoreAnnotation 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...
12
13
/**
14
 * @IgnoreAnnotation("OA\Get")
15
 * @IgnoreAnnotation("OA\Response")
16
 * @IgnoreAnnotation("OA\Parameter")
17
 * @IgnoreAnnotation("OA\Schema")
18
 */
19
final class LanguagesAction
20
{
21
    /**
22
     * @OA\Get(
23
     *     tags={"Crossword"},
24
     *     path="/api/crossword/languages",
25
     *     description="Supported languages",
26
     *     @OA\Response(response="default", description="Supported languages list"),
27
     * )
28
     */
29
    public function __invoke(SupportedLanguages $supportedLanguages): ResponseInterface
30
    {
31
        try {
32
            return new SuccessApiResponse($supportedLanguages->receive());
33
        } catch (NotFoundSupportedLanguagesException) {
34
            return new FailedApiResponse(ErrorFactory::languageIsNotFound());
35
        }
36
    }
37
}
38