mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-04 00:54:08 +02:00
We create the context ourselves
This commit is contained in:
parent
a96e4754f7
commit
7bde877610
1 changed files with 2 additions and 2 deletions
|
|
@ -45,9 +45,9 @@ class IteratorDirectory implements Directory {
|
||||||
} else {
|
} else {
|
||||||
throw new \BadMethodCallException('Invalid context, "' . $name . '" options not set');
|
throw new \BadMethodCallException('Invalid context, "' . $name . '" options not set');
|
||||||
}
|
}
|
||||||
if (isset($context['iterator']) and $context['iterator'] instanceof \Iterator) {
|
if (isset($context['iterator'])) {
|
||||||
$this->iterator = $context['iterator'];
|
$this->iterator = $context['iterator'];
|
||||||
} else if (isset($context['array']) and is_array($context['array'])) {
|
} else if (isset($context['array'])) {
|
||||||
$this->iterator = new \ArrayIterator($context['array']);
|
$this->iterator = new \ArrayIterator($context['array']);
|
||||||
} else {
|
} else {
|
||||||
throw new \BadMethodCallException('Invalid context, iterator or array not set');
|
throw new \BadMethodCallException('Invalid context, iterator or array not set');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue