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