Completed
Push — master ( 279fbd...ad3cda )
by Pieter
15s queued 12s
created

ErrorsGetter::getPriority()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace W2w\Lib\Apie\Plugins\Core\ObjectAccess\Getters;
4
5
use Symfony\Component\PropertyInfo\Type;
6
use W2w\Lib\ApieObjectAccessNormalizer\Exceptions\ValidationException;
7
use W2w\Lib\ApieObjectAccessNormalizer\Getters\GetterInterface;
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