| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | class ResourceGeneric |
||
| 23 | { |
||
| 24 | use ArrayAccessorTrait; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | protected $response; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Creates new resource |
||
| 33 | * |
||
| 34 | * @param array $response The response |
||
| 35 | */ |
||
| 36 | public function __construct(array $response = []) |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Returns a value by key using dot notation |
||
| 43 | * |
||
| 44 | * @param string $key The key to look |
||
| 45 | * @return mixed The value |
||
| 46 | */ |
||
| 47 | public function get($key) |
||
| 48 | { |
||
| 49 | return $this->getValueByKey($this->response, $key); |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Return all data of the resource as an array. |
||
| 54 | * |
||
| 55 | * @return array The response converted into an array |
||
| 56 | */ |
||
| 57 | public function toArray() |
||
| 60 | } |
||
| 61 | } |
||
| 62 |