Passed
Push — master ( 748bbc...6ff058 )
by Dominik
02:33
created

RequestUriTooLongMapping   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getClass() 0 4 1
A getNormalizationFieldMappings() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiHttp\Serialization\ApiProblem\ClientError;
6
7
use Chubbyphp\ApiHttp\ApiProblem\ClientError\RequestUriTooLong;
8
use Chubbyphp\ApiHttp\Serialization\ApiProblem\AbstractApiProblemMapping;
9
use Chubbyphp\Serialization\Mapping\NormalizationFieldMappingBuilder;
10
use Chubbyphp\Serialization\Mapping\NormalizationFieldMappingInterface;
11
12
final class RequestUriTooLongMapping extends AbstractApiProblemMapping
13
{
14
    /**
15
     * @return string
16
     */
17 1
    public function getClass(): string
18
    {
19 1
        return RequestUriTooLong::class;
20
    }
21
22
    /**
23
     * @param string $path
24
     *
25
     * @return NormalizationFieldMappingInterface[]
26
     */
27 1
    public function getNormalizationFieldMappings(string $path): array
28
    {
29 1
        $fieldMappings = parent::getNormalizationFieldMappings($path);
30
31 1
        $fieldMappings[] = NormalizationFieldMappingBuilder::create('maxUriLength')->getMapping();
32
33 1
        return $fieldMappings;
34
    }
35
}
36