| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| 1 | <?php |
||
| 22 | 5 | public function supports($object, string $property): bool |
|
| 23 | { |
||
| 24 | 5 | $refl = new \ReflectionObject($object); |
|
| 25 | 5 | $getter = (string) $this->getter->sprintf( |
|
| 26 | 5 | (string) (new StringPrimitive($property))->camelize() |
|
|
|
|||
| 27 | ); |
||
| 28 | |||
| 29 | 5 | return $refl->hasMethod($getter) && |
|
| 30 | 5 | $refl->getMethod($getter)->getNumberOfRequiredParameters() === 0; |
|
| 31 | } |
||
| 32 | |||
| 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.