Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 0 |
1 | <?php |
||
38 | private function collectAttributes(ReflectionClass $classMeta): array |
||
39 | 2 | { |
|
40 | $rules = []; |
||
41 | foreach ($classMeta->getProperties() as $property) { |
||
42 | 2 | $attributes = $property->getAttributes(RuleInterface::class, ReflectionAttribute::IS_INSTANCEOF); |
|
43 | foreach ($attributes as $attribute) { |
||
44 | 2 | /** @psalm-suppress UndefinedMethod */ |
|
45 | 2 | $rules[$property->getName()][] = $attribute->newInstance(); |
|
46 | 2 | } |
|
47 | } |
||
48 | |||
49 | return $rules; |
||
50 | 2 | } |
|
52 |