| 1 |
<?php |
| 2 |
namespace Aws; |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
trait HasDataTrait |
| 9 |
{ |
| 10 |
|
| 11 |
private $data = []; |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#[\ReturnTypeWillChange] |
| 17 |
public function getIterator() |
| 18 |
{ |
| 19 |
return new \ArrayIterator($this->data); |
| 20 |
} |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
#[\ReturnTypeWillChange] |
| 31 |
public function & offsetGet($offset) |
| 32 |
{ |
| 33 |
if (isset($this->data[$offset])) { |
| 34 |
return $this->data[$offset]; |
| 35 |
} |
| 36 |
|
| 37 |
$value = null; |
| 38 |
return $value; |
| 39 |
} |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
#[\ReturnTypeWillChange] |
| 45 |
public function offsetSet($offset, $value) |
| 46 |
{ |
| 47 |
$this->data[$offset] = $value; |
| 48 |
} |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
#[\ReturnTypeWillChange] |
| 54 |
public function offsetExists($offset) |
| 55 |
{ |
| 56 |
return isset($this->data[$offset]); |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
#[\ReturnTypeWillChange] |
| 63 |
public function offsetUnset($offset) |
| 64 |
{ |
| 65 |
unset($this->data[$offset]); |
| 66 |
} |
| 67 |
|
| 68 |
public function toArray() |
| 69 |
{ |
| 70 |
return $this->data; |
| 71 |
} |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
#[\ReturnTypeWillChange] |
| 77 |
public function count() |
| 78 |
{ |
| 79 |
return count($this->data); |
| 80 |
} |
| 81 |
} |