From 2eea1df4d50c8c1ef4c8e917ec6d5988ecd78945 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 1/3] UPDATE check if path is set to prevent warning on empty directory --- .../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 402033a5c2816..887559cf6f5cf 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 (empty($this->getPath())) { + return $this->rewindable = false; + } + if (false !== $stream = @opendir($this->getPath())) { $infos = stream_get_meta_data($stream); closedir($stream); From 26906de5e45e950a8e0a50c650c8390294a41777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Go=CC=88tz=20Gottwald?= Date: Tue, 16 Aug 2016 16:36:22 +0200 Subject: [PATCH 2/3] UPDATE check if path is set to prevent warning on empty directory --- .../Component/Finder/Iterator/RecursiveDirectoryIterator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php b/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php index 887559cf6f5cf..5f3bbae504d41 100644 --- a/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php +++ b/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php @@ -137,7 +137,7 @@ public function isRewindable() return $this->rewindable; } - if (empty($this->getPath())) { + if ($this->getPath() === '') { return $this->rewindable = false; } From 46fde82bd212d855150b443015c31f221a781453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Go=CC=88tz=20Gottwald?= Date: Wed, 7 Sep 2016 08:22:21 +0200 Subject: [PATCH 3/3] UPDATE using yoda condition --- .../Component/Finder/Iterator/RecursiveDirectoryIterator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php b/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php index 5f3bbae504d41..f011ce8d4d921 100644 --- a/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php +++ b/src/Symfony/Component/Finder/Iterator/RecursiveDirectoryIterator.php @@ -137,7 +137,7 @@ public function isRewindable() return $this->rewindable; } - if ($this->getPath() === '') { + if ('' === $this->getPath()) { return $this->rewindable = false; }