Passed
Push — master ( 4a0c9c...b2edbe )
by Dominik
01:57
created

ErrorMapping   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 48
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getClass() 0 4 1
A getType() 0 4 1
A getFieldMappings() 0 10 1
A getEmbeddedFieldMappings() 0 4 1
A getLinkMappings() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiHttp\Serialization;
6
7
use Chubbyphp\ApiHttp\Error\Error;
8
use Chubbyphp\Serialization\Mapping\FieldMapping;
9
use Chubbyphp\Serialization\Mapping\FieldMappingInterface;
10
use Chubbyphp\Serialization\Mapping\LinkMappingInterface;
11
use Chubbyphp\Serialization\Mapping\ObjectMappingInterface;
12
13
final class ErrorMapping implements ObjectMappingInterface
14
{
15
    /**
16
     * @return string
17
     */
18 1
    public function getClass(): string
19
    {
20 1
        return Error::class;
21
    }
22
23
    /**
24
     * @return string
25
     */
26 1
    public function getType(): string
27
    {
28 1
        return 'error';
29
    }
30
31
    /**
32
     * @return FieldMappingInterface[]
33
     */
34 1
    public function getFieldMappings(): array
35
    {
36
        return [
37 1
            new FieldMapping('scope'),
38 1
            new FieldMapping('key'),
39 1
            new FieldMapping('detail'),
40 1
            new FieldMapping('reference'),
41 1
            new FieldMapping('arguments'),
42
        ];
43
    }
44
45
    /**
46
     * @return FieldMappingInterface[]
47
     */
48 1
    public function getEmbeddedFieldMappings(): array
49
    {
50 1
        return [];
51
    }
52
53
    /**
54
     * @return LinkMappingInterface[]
55
     */
56 1
    public function getLinkMappings(): array
57
    {
58 1
        return [];
59
    }
60
}
61