diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index d18c3b387..d1200dde9 100644 --- a/src/Composer/Util/Filesystem.php +++ b/src/Composer/Util/Filesystem.php @@ -597,16 +597,15 @@ class Filesystem */ public function relativeSymlink($target, $link) { + if (!function_exists('symlink')) { + return false; + } + $cwd = getcwd(); $relativePath = $this->findShortestPath($link, $target); chdir(\dirname($link)); - - if (function_exists('symlink')) { - $result = @symlink($relativePath, $link); - } else { - $result = false; - } + $result = @symlink($relativePath, $link); chdir($cwd);