1 | <?php |
||
10 | class RegistryCollection implements \IteratorAggregate, \ArrayAccess |
||
11 | { |
||
12 | /** |
||
13 | * @var Registry[] |
||
14 | */ |
||
15 | protected $registries = []; |
||
16 | |||
17 | /** |
||
18 | * RegistryCollection constructor. |
||
19 | * @param array $registries |
||
20 | */ |
||
21 | public function __construct(array $registries = []) |
||
25 | |||
26 | /** |
||
27 | * Add a registry |
||
28 | * @param Registry $registry |
||
29 | */ |
||
30 | public function add(Registry $registry) |
||
34 | |||
35 | /** |
||
36 | * Add a registry |
||
37 | * @param Registry $registry |
||
38 | */ |
||
39 | public function remove(Registry $registry) |
||
47 | |||
48 | /** |
||
49 | * Get all registries |
||
50 | * @return Registry[] |
||
51 | */ |
||
52 | public function all() |
||
56 | |||
57 | /** |
||
58 | * Convert to array |
||
59 | * @return array |
||
60 | */ |
||
61 | public function toArray() |
||
67 | |||
68 | /** |
||
69 | * @param $data |
||
70 | * @throws InvalidArgumentException |
||
71 | * @return static |
||
72 | */ |
||
73 | public static function fromArray($data) |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function getIterator() |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function offsetExists($offset) |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function offsetGet($offset) |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function offsetUnset($offset) |
||
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | public function offsetSet($offset, $value) |
||
119 | } |
||
120 |