diff --git a/src/Storage/Adapter/FilesystemIterator.php b/src/Storage/Adapter/FilesystemIterator.php index ede9db20d..800e038ad 100644 --- a/src/Storage/Adapter/FilesystemIterator.php +++ b/src/Storage/Adapter/FilesystemIterator.php @@ -16,9 +16,9 @@ class FilesystemIterator implements IteratorInterface { /** - * The apc storage instance + * The Filesystem storage instance * - * @var Apc + * @var Filesystem */ protected $storage; @@ -89,7 +89,7 @@ public function getMode() * Set iterator mode * * @param int $mode - * @return ApcIterator Fluent interface + * @return FilesystemIterator Fluent interface */ public function setMode($mode) { @@ -164,10 +164,17 @@ public function valid() /** * Rewind the Iterator to the first element. * - * @return void + * @return bool false if the operation failed. */ public function rewind() { - return $this->globIterator->rewind(); + try { + return $this->globIterator->rewind(); + } catch (\LogicException $e) { + // @link https://bugs.php.net/bug.php?id=55701 + // GlobIterator throws LogicException with message + // 'The parent constructor was not called: the object is in an invalid state' + return false; + } } } diff --git a/test/TestAsset/DummyPattern.php b/test/TestAsset/DummyPattern.php deleted file mode 100644 index fd46dedbc..000000000 --- a/test/TestAsset/DummyPattern.php +++ /dev/null @@ -1,30 +0,0 @@ -_dummyOption = $value; - return $this; - } - - public function getDummyOption() - { - return $this->_dummyOption; - } -} diff --git a/test/TestAsset/DummyStorageAdapter.php b/test/TestAsset/DummyStorageAdapter.php deleted file mode 100644 index c51afb9b9..000000000 --- a/test/TestAsset/DummyStorageAdapter.php +++ /dev/null @@ -1,17 +0,0 @@ -setOptions($options); - } -}