|
@@ 117-127 (lines=11) @@
|
| 114 |
|
{
|
| 115 |
|
// Analyze method definitions
|
| 116 |
|
foreach ($reflectionClass->getMethods() as $reflectionMethod) {
|
| 117 |
|
foreach ($this->methodAnalyzers as $methodAnalyzer) {
|
| 118 |
|
if ($methodAnalyzer instanceof MethodAnalyzerInterface) {
|
| 119 |
|
$methodDefinition = $classDefinition->getMethodsCollection()[$reflectionMethod->getName()] ?? null;
|
| 120 |
|
$methodAnalyzer->analyze($this, $reflectionMethod, $classDefinition, $methodDefinition);
|
| 121 |
|
} else {
|
| 122 |
|
throw new WrongAnalyzerTypeException(sprintf(
|
| 123 |
|
'Analyzer "%s" should implements MethodAnalyzerInterface',
|
| 124 |
|
get_class($methodAnalyzer)
|
| 125 |
|
));
|
| 126 |
|
}
|
| 127 |
|
}
|
| 128 |
|
$methodDefinition = $classDefinition->getMethodsCollection()[$reflectionMethod->getName()] ?? null;
|
| 129 |
|
$this->analyzeParameter($reflectionMethod, $classDefinition, $methodDefinition);
|
| 130 |
|
}
|
|
@@ 143-156 (lines=14) @@
|
| 140 |
|
protected function analyzeProperty(\ReflectionClass $reflectionClass, ClassDefinition $classDefinition)
|
| 141 |
|
{
|
| 142 |
|
// Iterate class properties
|
| 143 |
|
foreach ($reflectionClass->getProperties() as $reflectionProperty) {
|
| 144 |
|
// Analyze property definition
|
| 145 |
|
foreach ($this->propertyAnalyzers as $propertyAnalyzer) {
|
| 146 |
|
if ($propertyAnalyzer instanceof PropertyAnalyzerInterface) {
|
| 147 |
|
$propertyDefinition = $classDefinition->getPropertiesCollection()[$reflectionProperty->getName()] ?? null;
|
| 148 |
|
$propertyAnalyzer->analyze($this, $reflectionProperty, $classDefinition, $propertyDefinition);
|
| 149 |
|
} else {
|
| 150 |
|
throw new WrongAnalyzerTypeException(sprintf(
|
| 151 |
|
'Analyzer "%s" should implements PropertyAnalyzerInterface',
|
| 152 |
|
get_class($propertyAnalyzer)
|
| 153 |
|
));
|
| 154 |
|
}
|
| 155 |
|
}
|
| 156 |
|
}
|
| 157 |
|
}
|
| 158 |
|
|
| 159 |
|
/**
|