Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
42 | public function inject(object $object, string $property, $value): object |
||
43 | 5 | { |
|
44 | 1 | if (!$this->supports($object, $property, $value)) { |
|
45 | throw new LogicException; |
||
46 | } |
||
47 | 4 | ||
48 | 4 | $setter = $this |
|
49 | ->setter |
||
50 | 4 | ->sprintf(Str::of($property)->camelize()->ucfirst()->toString()) |
|
51 | ->toString(); |
||
52 | 4 | ||
53 | /** @psalm-suppress MixedMethodCall */ |
||
54 | $object->$setter($value); |
||
55 | |||
56 | return $object; |
||
57 | } |
||
59 |