Total Complexity | 14 |
Total Lines | 79 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | abstract class Reader implements ReaderInterface |
||
15 | { |
||
16 | /** |
||
17 | * {@inheritDoc} |
||
18 | */ |
||
19 | public function firstClassMetadata(\ReflectionClass $class, string $name): ?object |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * {@inheritDoc} |
||
30 | */ |
||
31 | public function firstFunctionMetadata(\ReflectionFunctionAbstract $function, string $name): ?object |
||
32 | { |
||
33 | foreach ($this->getFunctionMetadata($function, $name) as $attribute) { |
||
34 | return $attribute; |
||
35 | } |
||
36 | |||
37 | return null; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * {@inheritDoc} |
||
42 | */ |
||
43 | public function firstPropertyMetadata(\ReflectionProperty $property, string $name): ?object |
||
44 | { |
||
45 | foreach ($this->getPropertyMetadata($property, $name) as $attribute) { |
||
46 | return $attribute; |
||
47 | } |
||
48 | |||
49 | return null; |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * {@inheritDoc} |
||
54 | */ |
||
55 | public function firstConstantMetadata(\ReflectionClassConstant $constant, string $name): ?object |
||
56 | { |
||
57 | foreach ($this->getConstantMetadata($constant, $name) as $attribute) { |
||
58 | return $attribute; |
||
59 | } |
||
60 | |||
61 | return null; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | public function firstParameterMetadata(\ReflectionParameter $parameter, string $name): ?object |
||
74 | } |
||
75 | |||
76 | /** |
||
77 | * @template T of object |
||
78 | * @param class-string<T>|null $name |
||
|
|||
79 | * @param iterable<T|object> $annotations |
||
80 | * @return iterable<T> |
||
81 | */ |
||
82 | protected function filter(?string $name, iterable $annotations): iterable |
||
93 | } |
||
94 | } |
||
95 | } |
||
97 |