diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index d1200dde9..0c0309c55 100644 --- a/src/Composer/Util/Filesystem.php +++ b/src/Composer/Util/Filesystem.php @@ -63,7 +63,7 @@ class Filesystem public function emptyDirectory($dir, $ensureDirectoryExists = true) { - if (file_exists($dir) && is_link($dir)) { + if (is_link($dir) && file_exists($dir)) { $this->unlink($dir); } @@ -600,7 +600,7 @@ class Filesystem if (!function_exists('symlink')) { return false; } - + $cwd = getcwd(); $relativePath = $this->findShortestPath($link, $target);