Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
41 | 4 | public function extract(object $object, string $property) |
|
42 | { |
||
43 | 4 | if (!$this->supports($object, $property)) { |
|
44 | 1 | throw new LogicException; |
|
45 | } |
||
46 | |||
47 | 3 | $property = Str::of($property) |
|
48 | 3 | ->camelize() |
|
49 | 3 | ->toString(); |
|
50 | |||
51 | 3 | /** @psalm-suppress MixedMethodCall */ |
|
52 | return $object->$property(); |
||
53 | } |
||
55 |