| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 6 | public function supports(object $object, string $property): bool |
|
| 25 | { |
||
| 26 | 6 | $refl = new \ReflectionObject($object); |
|
| 27 | 6 | $hasser = $this |
|
| 28 | 6 | ->hasser |
|
| 29 | ->sprintf(Str::of($property)->camelize()->ucfirst()->toString()) |
||
| 30 | ->toString(); |
||
| 31 | 6 | ||
| 32 | 4 | if (!$refl->hasMethod($hasser)) { |
|
| 33 | return false; |
||
| 34 | } |
||
| 35 | 3 | ||
| 36 | $hasser = $refl->getMethod($hasser); |
||
| 37 | 3 | ||
| 38 | 1 | if (!$hasser->isPublic()) { |
|
| 39 | return false; |
||
| 40 | } |
||
| 41 | 3 | ||
| 42 | return $hasser->getNumberOfRequiredParameters() === 0; |
||
| 43 | } |
||
| 63 |