| Total Complexity | 5 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 63.64% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class DelegateAccessor implements PropertyAccessorInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The reader accessor |
||
| 12 | * |
||
| 13 | * @var PropertyAccessorInterface |
||
| 14 | */ |
||
| 15 | private $reader; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The writer accessor |
||
| 19 | * |
||
| 20 | * @var PropertyAccessorInterface |
||
| 21 | */ |
||
| 22 | private $writer; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * DelegateAccessor constructor. |
||
| 26 | * |
||
| 27 | * @param PropertyAccessorInterface $reader |
||
| 28 | * @param PropertyAccessorInterface $writer |
||
| 29 | */ |
||
| 30 | 8 | public function __construct(PropertyAccessorInterface $reader, PropertyAccessorInterface $writer) |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | public function write($object, $value) |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * {@inheritdoc} |
||
| 46 | */ |
||
| 47 | public function read($object) |
||
| 48 | { |
||
| 49 | return $this->reader->read($object); |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get the writer accessor |
||
| 54 | * |
||
| 55 | * @return PropertyAccessorInterface |
||
| 56 | */ |
||
| 57 | 8 | public function getWriter(): PropertyAccessorInterface |
|
| 58 | { |
||
| 59 | 8 | return $this->writer; |
|
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Get the reader accessor |
||
| 64 | * |
||
| 65 | * @return PropertyAccessorInterface |
||
| 66 | */ |
||
| 67 | 8 | public function getReader(): PropertyAccessorInterface |
|
| 70 | } |
||
| 71 | } |
||
| 72 |