| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 85.71% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | trait PropertyAccessorTrait |
||
| 13 | { |
||
| 14 | /** @var object $object */ |
||
| 15 | private $object; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * PropertyAccessorTrait constructor. |
||
| 19 | * |
||
| 20 | * @param object $object the object ot gain access to. |
||
| 21 | */ |
||
| 22 | 96 | public function __construct($object) |
|
| 23 | { |
||
| 24 | 96 | $this->object = $object; |
|
| 25 | 96 | } |
|
| 26 | |||
| 27 | /** |
||
| 28 | * Access a property. |
||
| 29 | * |
||
| 30 | * @param string $property the property to access. |
||
| 31 | * @param mixed|null $value the value to set. |
||
| 32 | * |
||
| 33 | * @return void |
||
| 34 | * @throws InvalidArgumentException when property does not exists |
||
| 35 | */ |
||
| 36 | 90 | public function setObjectProperty($property, $value = null) |
|
| 43 | } |
||
| 44 | } |