| @@ 34-43 (lines=10) @@ | ||
| 31 | /** |
|
| 32 | * {@inheritdoc} |
|
| 33 | */ |
|
| 34 | public function extract($object, string $property) |
|
| 35 | { |
|
| 36 | if (!$this->supports($object, $property)) { |
|
| 37 | throw new LogicException; |
|
| 38 | } |
|
| 39 | ||
| 40 | $getter = (string) $this->getter->sprintf(ucfirst($property)); |
|
| 41 | ||
| 42 | return $object->$getter(); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| @@ 34-42 (lines=9) @@ | ||
| 31 | /** |
|
| 32 | * {@inheritdoc} |
|
| 33 | */ |
|
| 34 | public function inject($object, string $property, $value) |
|
| 35 | { |
|
| 36 | if (!$this->supports($object, $property, $value)) { |
|
| 37 | throw new LogicException; |
|
| 38 | } |
|
| 39 | ||
| 40 | $setter = (string) $this->setter->sprintf(ucfirst($property)); |
|
| 41 | $object->$setter($value); |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||