AnnotatedProperty::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiistack\Annotated;
6
7
use ReflectionClass;
8
use ReflectionProperty;
9
10
final class AnnotatedProperty
11
{
12
    private ReflectionProperty $property;
13
    private object $annotation;
14
15 2
    public function __construct(ReflectionProperty $property, object $annotation)
16
    {
17 2
        $this->property = $property;
18 2
        $this->annotation = $annotation;
19
    }
20
21
    public function getClass(): ReflectionClass
22
    {
23
        return $this->property->getDeclaringClass();
24
    }
25
26
    public function getProperty(): ReflectionProperty
27
    {
28
        return $this->property;
29
    }
30
31
    public function getAnnotation(): object
32
    {
33
        return $this->annotation;
34
    }
35
}
36