| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types = 1); |
||
| 27 | 4 | public function analyze( |
|
| 28 | DefinitionAnalyzer $analyzer, |
||
| 29 | ClassDefinition $classDefinition, |
||
| 30 | \ReflectionMethod $reflectionMethod |
||
| 31 | ) { |
||
| 32 | 4 | $methodName = $reflectionMethod->getName(); |
|
|
|
|||
| 33 | // Constructor definition is required |
||
| 34 | 4 | if ($methodName === '__construct' && !$classDefinition->hasMethod('__construct')) { |
|
| 35 | 1 | $classDefinition->defineConstructor()->end(); |
|
| 36 | } |
||
| 37 | // Set method metadata |
||
| 38 | 4 | if ($classDefinition->hasMethod($methodName)) { |
|
| 39 | 4 | $classDefinition->getMethod($methodName) |
|
| 40 | 4 | ->setModifiers($reflectionMethod->getModifiers()) |
|
| 41 | 4 | ->setIsPublic($reflectionMethod->isPublic()); |
|
| 42 | } |
||
| 43 | 4 | } |
|
| 44 | } |
||
| 45 |