ErrorsGetter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPriority() 0 3 1
A getName() 0 3 1
A toType() 0 9 1
A getValue() 0 3 1
1
<?php
2
3
namespace Apie\CorePlugin\ObjectAccess\Getters;
4
5
use Apie\ObjectAccessNormalizer\Exceptions\ValidationException;
6
use Apie\ObjectAccessNormalizer\Getters\GetterInterface;
7
use Symfony\Component\PropertyInfo\Type;
8
9
/**
10
 * Mapping getErrors for ValidationException
11
 *
12
 * @see ValidationException
13
 * @internal
14
 */
15
class ErrorsGetter implements GetterInterface
16
{
17
    public function getName(): string
18
    {
19
        return 'errors';
20
    }
21
22
    public function getValue($object)
23
    {
24
        return $object->getErrors();
25
    }
26
27
    public function toType(): ?Type
28
    {
29
        return new Type(
30
            Type::BUILTIN_TYPE_ARRAY,
31
            false,
32
            null,
33
            true,
34
            new Type(Type::BUILTIN_TYPE_STRING),
35
            new Type(Type::BUILTIN_TYPE_ARRAY)
36
        );
37
    }
38
39
    public function getPriority(): int
40
    {
41
        return 0;
42
    }
43
}
44