diff --git a/src/Composer/Repository/Vcs/BitbucketDriver.php b/src/Composer/Repository/Vcs/BitbucketDriver.php index 1c0b63cb5..e2497aa72 100644 --- a/src/Composer/Repository/Vcs/BitbucketDriver.php +++ b/src/Composer/Repository/Vcs/BitbucketDriver.php @@ -86,7 +86,9 @@ abstract class BitbucketDriver extends VcsDriver $this->owner, $this->repository, http_build_query( - array('fields' => '-project,-owner') + array('fields' => '-project,-owner'), + null, + '&' ) ); @@ -266,7 +268,9 @@ abstract class BitbucketDriver extends VcsDriver 'pagelen' => 100, 'fields' => 'values.name,values.target.hash,next', 'sort' => '-target.date' - ) + ), + null, + '&' ) ); $hasNext = true; @@ -308,7 +312,9 @@ abstract class BitbucketDriver extends VcsDriver 'pagelen' => 100, 'fields' => 'values.name,values.target.hash,next', 'sort' => '-target.date' - ) + ), + null, + '&' ) ); $hasNext = true; diff --git a/src/Composer/Repository/Vcs/GitBitbucketDriver.php b/src/Composer/Repository/Vcs/GitBitbucketDriver.php index 292ab01b1..82fe69028 100644 --- a/src/Composer/Repository/Vcs/GitBitbucketDriver.php +++ b/src/Composer/Repository/Vcs/GitBitbucketDriver.php @@ -43,8 +43,8 @@ class GitBitbucketDriver extends BitbucketDriver ); } - $main_branch_data = $this->getMainBranchData(); - $this->rootIdentifier = !empty($main_branch_data['name']) ? $main_branch_data['name'] : 'master'; + $mainBranchData = $this->getMainBranchData(); + $this->rootIdentifier = !empty($mainBranchData['name']) ? $mainBranchData['name'] : 'master'; } return $this->rootIdentifier; diff --git a/src/Composer/Repository/Vcs/HgBitbucketDriver.php b/src/Composer/Repository/Vcs/HgBitbucketDriver.php index cf76a5115..e908f9ce6 100644 --- a/src/Composer/Repository/Vcs/HgBitbucketDriver.php +++ b/src/Composer/Repository/Vcs/HgBitbucketDriver.php @@ -43,8 +43,8 @@ class HgBitbucketDriver extends BitbucketDriver ); } - $main_branch_data = $this->getMainBranchData(); - $this->rootIdentifier = !empty($main_branch_data['name']) ? $main_branch_data['name'] : 'default'; + $mainBranchData = $this->getMainBranchData(); + $this->rootIdentifier = !empty($mainBranchData['name']) ? $mainBranchData['name'] : 'default'; } return $this->rootIdentifier; diff --git a/src/Composer/Util/Bitbucket.php b/src/Composer/Util/Bitbucket.php index 152fe5fa0..e1f319768 100644 --- a/src/Composer/Util/Bitbucket.php +++ b/src/Composer/Util/Bitbucket.php @@ -227,9 +227,7 @@ class Bitbucket { $authConfig = $this->config->get('bitbucket-oauth'); - if (empty($authConfig) || - ! isset($authConfig[$originUrl]) || - ! isset($authConfig[$originUrl]['access-token']) || + if (! isset($authConfig[$originUrl]['access-token']) || ! isset($authConfig[$originUrl]['access-token-expiration']) || time() > $authConfig[$originUrl]['access-token-expiration'] ) { diff --git a/src/Composer/Util/Git.php b/src/Composer/Util/Git.php index 90722bc5a..97b36ef19 100644 --- a/src/Composer/Util/Git.php +++ b/src/Composer/Util/Git.php @@ -122,17 +122,17 @@ class Git if (!$bitbucketUtil->authorizeOAuth($match[1]) && $this->io->isInteractive()) { $bitbucketUtil->authorizeOAuthInteractively($match[1], $message); - $access_token = $bitbucketUtil->getToken(); - $this->io->setAuthentication($match[1], 'x-token-auth', $access_token); + $accessToken = $bitbucketUtil->getToken(); + $this->io->setAuthentication($match[1], 'x-token-auth', $accessToken); } } else { //We're authenticating with a locally stored consumer. $auth = $this->io->getAuthentication($match[1]); //We already have an access_token from a previous request. if ($auth['username'] !== 'x-token-auth') { - $access_token = $bitbucketUtil->requestToken($match[1], $auth['username'], $auth['password']); - if (! empty($access_token)) { - $this->io->setAuthentication($match[1], 'x-token-auth', $access_token); + $accessToken = $bitbucketUtil->requestToken($match[1], $auth['username'], $auth['password']); + if (! empty($accessToken)) { + $this->io->setAuthentication($match[1], 'x-token-auth', $accessToken); } } }