| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | 5 | public function inject(object $object, string $property, $value): object |
|
| 52 | { |
||
| 53 | 5 | if (!$this->supports($object, $property, $value)) { |
|
| 54 | 1 | throw new LogicException; |
|
| 55 | } |
||
| 56 | |||
| 57 | 4 | $property = Str::of($property) |
|
| 58 | 4 | ->camelize() |
|
| 59 | 4 | ->toString(); |
|
| 60 | |||
| 61 | 4 | /** @psalm-suppress MixedMethodCall */ |
|
| 62 | $object->$property($value); |
||
| 63 | 4 | ||
| 64 | return $object; |
||
| 65 | } |
||
| 67 |