| 1 | <?php |
||
| 13 | class PropertyAccessor |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Get a property value by a path of property names or key names. |
||
| 17 | * |
||
| 18 | * @param mixed $subject |
||
| 19 | * @param array $path |
||
| 20 | * @param bool $notFoundIsError |
||
| 21 | * @return null |
||
| 22 | * |
||
| 23 | * @throws \InvalidArgumentException |
||
| 24 | */ |
||
| 25 | 6 | public static function getByPath($subject, array $path, $notFoundIsError = true) |
|
| 42 | |||
| 43 | |||
| 44 | /** |
||
| 45 | * Set a property value by a path of property or key names. |
||
| 46 | * |
||
| 47 | * @param mixed &$subject |
||
| 48 | * @param array $path |
||
| 49 | * @param mixed $value |
||
| 50 | * @return mixed |
||
| 51 | */ |
||
| 52 | 8 | public static function setByPath(&$subject, array $path, $value) |
|
| 71 | } |