We already the checks earlier

This commit is contained in:
Robin Appelman 2014-07-31 01:46:15 +02:00
commit 5aae45f2dd

View file

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