Conditions | 5 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5.0342 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | 156 | public function getMetadataForClass(ReflectionClass $class): ?ClassMetadata |
|
37 | { |
||
38 | 156 | if ($class->isInterface() || !$class->hasMethod($this->method)) { |
|
39 | 72 | return null; |
|
40 | } |
||
41 | |||
42 | 86 | $method = $class->getMethod($this->method); |
|
43 | |||
44 | 86 | if ($method->isAbstract() || !$method->isStatic()) { |
|
45 | return null; |
||
46 | } |
||
47 | |||
48 | 86 | $builder = new ClassMetadataBuilder($class); |
|
49 | 86 | $method->invoke(null, $builder); |
|
50 | |||
51 | 86 | return $builder->build(); |
|
52 | } |
||
54 |