소스 검색

Simplify the if statement.

Stefan Grootscholten 9 년 전
부모
커밋
1241e3e83c
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/Composer/Util/RemoteFilesystem.php

+ 4 - 4
src/Composer/Util/RemoteFilesystem.php

@@ -695,10 +695,10 @@ class RemoteFilesystem
                 if ($auth['password'] === 'oauth2') {
                     $headers[] = 'Authorization: Bearer '.$auth['username'];
                 }
-            } elseif ('bitbucket.org' === $originUrl && $this->fileUrl !== Bitbucket::OAUTH2_ACCESS_TOKEN_URL) {
-                if ('x-token-auth' === $auth['username']) {
-                    $options['bitbucket-token'] = $auth['password'];
-                }
+            } elseif ('bitbucket.org' === $originUrl
+                && $this->fileUrl !== Bitbucket::OAUTH2_ACCESS_TOKEN_URL && 'x-token-auth' === $auth['username']
+            ) {
+                $options['bitbucket-token'] = $auth['password'];
             } else {
                 $authStr = base64_encode($auth['username'] . ':' . $auth['password']);
                 $headers[] = 'Authorization: Basic '.$authStr;