| Conditions | 3 |
| Paths | 3 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public static function generateMethod( |
||
| 23 | 1 | MethodReflection $originalMethod, |
|
| 24 | PropertyGenerator $valueHolderProperty, |
||
| 25 | PropertyGenerator $prefixInterceptors, |
||
| 26 | PropertyGenerator $suffixInterceptors |
||
| 27 | ) : self { |
||
| 28 | /** @var self $method */ |
||
| 29 | $method = static::fromReflectionWithoutBodyAndDocBlock($originalMethod); |
||
| 30 | 1 | $forwardedParams = []; |
|
| 31 | 1 | ||
| 32 | foreach ($originalMethod->getParameters() as $parameter) { |
||
| 33 | 1 | $forwardedParams[] = ($parameter->isVariadic() ? '...' : '') . '$' . $parameter->getName(); |
|
|
|
|||
| 34 | 1 | } |
|
| 35 | |||
| 36 | $method->setBody(InterceptorGenerator::createInterceptedMethodBody( |
||
| 37 | 1 | '$returnValue = $this->' . $valueHolderProperty->getName() . '->' |
|
| 38 | 1 | . $originalMethod->getName() . '(' . implode(', ', $forwardedParams) . ');', |
|
| 39 | 1 | $method, |
|
| 40 | 1 | $valueHolderProperty, |
|
| 41 | 1 | $prefixInterceptors, |
|
| 42 | 1 | $suffixInterceptors, |
|
| 43 | 1 | $originalMethod |
|
| 44 | 1 | )); |
|
| 45 | |||
| 46 | return $method; |
||
| 47 | 1 | } |
|
| 48 | } |
||
| 49 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.