From 695e3412587b5a876f8b05f9b74b98ca958a8b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Go=CC=88tz=20Gottwald?= Date: Tue, 16 Aug 2016 16:22:05 +0200 Subject: [PATCH] [Finder] no PHP warning on empty directory iteration --- .../Component/Finder/Iterator/RecursiveDirectoryIterator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php b/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php index 402033a5c281..f011ce8d4d92 100644 --- a/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php +++ b/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php @@ -137,6 +137,10 @@ public function isRewindable() return $this->rewindable; } + if ('' === $this->getPath()) { + return $this->rewindable = false; + } + if (false !== $stream = @opendir($this->getPath())) { $infos = stream_get_meta_data($stream); closedir($stream);