1<?php
2namespace GuzzleHttp\Ring\Future;
3
4/**
5 * Represents a future array value that when dereferenced returns an array.
6 */
7class FutureArray implements FutureArrayInterface
8{
9    use MagicFutureTrait;
10
11    public function offsetExists($offset)
12    {
13        return isset($this->_value[$offset]);
14    }
15
16    public function offsetGet($offset)
17    {
18        return $this->_value[$offset];
19    }
20
21    public function offsetSet($offset, $value)
22    {
23        $this->_value[$offset] = $value;
24    }
25
26    public function offsetUnset($offset)
27    {
28        unset($this->_value[$offset]);
29    }
30
31    public function count()
32    {
33        return count($this->_value);
34    }
35
36    public function getIterator()
37    {
38        return new \ArrayIterator($this->_value);
39    }
40}
41