autodetect class and protocol

This commit is contained in:
Robin Appelman 2019-03-11 15:33:30 +01:00
commit 3171a535de
12 changed files with 28 additions and 15 deletions

View file

@ -115,7 +115,7 @@ class IteratorDirectory implements Directory {
} else {
throw new \BadMethodCallException('$source should be an Iterator or array');
}
stream_wrapper_register('iterator', '\Icewind\Streams\IteratorDirectory');
stream_wrapper_register('iterator', static::class);
$wrapped = opendir('iterator://', $context);
stream_wrapper_unregister('iterator');
return $wrapped;