diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index 79e8420688821..a1ff41e892b70 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -498,7 +498,9 @@ public function dumpFile($filename, $content, $mode = 0666) if (!is_dir($dir)) { $this->mkdir($dir); - } elseif (!is_writable($dir)) { + } + + if (!is_writable($dir)) { throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir); }