| Total Complexity | 11 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class Collection implements \ArrayAccess |
||
| 16 | { |
||
| 17 | /** @var Result $data */ |
||
| 18 | private $data; |
||
| 19 | private $marshaler; |
||
| 20 | |||
| 21 | public function __construct($data) |
||
| 22 | { |
||
| 23 | $this->data = $data; |
||
| 24 | |||
| 25 | } |
||
| 26 | |||
| 27 | public function __get($var) |
||
| 28 | { |
||
| 29 | var_dump(1); |
||
|
|
|||
| 30 | die; |
||
| 31 | } |
||
| 32 | |||
| 33 | private function getMarshaler() |
||
| 34 | { |
||
| 35 | if (!$this->marshaler) { |
||
| 36 | $this->marshaler = new Marshaler(); |
||
| 37 | } |
||
| 38 | return $this->marshaler; |
||
| 39 | |||
| 40 | } |
||
| 41 | |||
| 42 | |||
| 43 | public function offsetExists($offset) |
||
| 44 | { |
||
| 45 | return isset($this->data[$offset]); |
||
| 46 | } |
||
| 47 | |||
| 48 | |||
| 49 | public function offsetGet($offset) |
||
| 50 | { |
||
| 51 | if (isset($this->data[$offset])) { |
||
| 52 | return $this->getMarshaler()->unmarshalItem($this->data[$offset]); |
||
| 53 | } |
||
| 54 | return null; |
||
| 55 | } |
||
| 56 | |||
| 57 | |||
| 58 | public function offsetSet($offset, $value) |
||
| 59 | { |
||
| 60 | $this->data[$offset] = $value; |
||
| 61 | } |
||
| 62 | |||
| 63 | |||
| 64 | public function offsetUnset($offset) |
||
| 67 | } |
||
| 68 | |||
| 69 | public function toArray() |
||
| 70 | { |
||
| 71 | |||
| 72 | $result = []; |
||
| 77 | } |
||
| 78 | } |