From 11f1e037392035c7983613b5a037ee04993c16ad Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 3 Nov 2017 19:44:44 +0100 Subject: [PATCH] CS tweaks --- src/Composer/Util/RemoteFilesystem.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index a9f788de0..aa8a45698 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -195,12 +195,14 @@ class RemoteFilesystem $originUrl = 'github.com'; } - // Gitlab can be installed in a non-root context. When downloading archives the originalUrl is the host without - // the relative path, so we look for the registered gitlab-domains that matching the host here - if (is_array($this->config->get('gitlab-domains')) + // Gitlab can be installed in a non-root context (i.e. gitlab.com/foo). When downloading archives the originUrl + // is the host without the path, so we look for the registered gitlab-domains matching the host here + if ( + is_array($this->config->get('gitlab-domains')) && false === strpos($originUrl, '/') - && !in_array($originUrl, $this->config->get('gitlab-domains'))) { - foreach($this->config->get('gitlab-domains') as $gitlabDomain) { + && !in_array($originUrl, $this->config->get('gitlab-domains')) + ) { + foreach ($this->config->get('gitlab-domains') as $gitlabDomain) { if (0 === strpos($gitlabDomain, $originUrl)) { $originUrl = $gitlabDomain; break;