Completed
Push — master ( 812d68...15b189 )
by Pieter
17s queued 10s
created

ReflectionPropertyGetter::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
4
namespace W2w\Lib\ApieObjectAccessNormalizer\Getters;
5
6
use ReflectionProperty;
7
use Symfony\Component\PropertyInfo\Type;
8
use W2w\Lib\ApieObjectAccessNormalizer\TypeUtils;
9
10
class ReflectionPropertyGetter implements GetterInterface
11
{
12
    /**
13
     * @var ReflectionProperty
14
     */
15
    private $property;
16
17
    public function __construct(ReflectionProperty $property)
18
    {
19
        $this->property = $property;
20
    }
21
22
    public function getName(): string
23
    {
24
        return $this->property->getName();
25
    }
26
27
    public function getValue($object)
28
    {
29
        return $this->property->getValue($object);
30
    }
31
32
    public function getPriority(): int
33
    {
34
        return 0;
35
    }
36
37
    public function toType(): ?Type
38
    {
39
        return TypeUtils::convertPropertyToType($this->property);
40
    }
41
}
42