Skip to content

Commit

Permalink
Update dependencies and code style
Browse files Browse the repository at this point in the history
  • Loading branch information
curry684 committed Mar 19, 2018
1 parent bc699ef commit 17d57be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -43,7 +43,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"
"dev-master": "3.x-dev"
}
}
}
6 changes: 3 additions & 3 deletions src/Provider/Gitlab.php
Expand Up @@ -85,7 +85,7 @@ public function getResourceOwnerDetailsUrl(AccessToken $token)

/**
* Get the default scopes used by GitLab.
* Current scopes are 'api', 'read_user', 'openid'
* Current scopes are 'api', 'read_user', 'openid'.
*
* This returns an array with 'api' scope as default.
*
Expand All @@ -97,7 +97,7 @@ protected function getDefaultScopes()
}

/**
* GitLab uses a space to separate scopes
* GitLab uses a space to separate scopes.
*/
protected function getScopeSeparator()
{
Expand All @@ -108,7 +108,7 @@ protected function getScopeSeparator()
* Check a provider response for errors.
*
* @param ResponseInterface $response
* @param string $data Parsed response data
* @param string|array $data Parsed response data
* @throws IdentityProviderException
*/
protected function checkResponse(ResponseInterface $response, $data)
Expand Down
4 changes: 3 additions & 1 deletion src/Provider/GitlabResourceOwner.php
Expand Up @@ -66,6 +66,7 @@ public function getApiClient()
throw new \LogicException(__METHOD__ . ' requires package m4tthumphrey/php-gitlab-api to be installed and autoloaded'); // @codeCoverageIgnore
}
$client = \Gitlab\Client::create(rtrim($this->domain, '/') . self::PATH_API);

return $client->authenticate($this->token->getToken(), Client::AUTH_OAUTH_TOKEN);
}

Expand All @@ -84,6 +85,7 @@ public function getDomain()
public function setDomain($domain)
{
$this->domain = $domain;

return $this;
}

Expand Down Expand Up @@ -152,7 +154,7 @@ public function getToken()
*/
public function isActive()
{
return $this->get('state') === 'active';
return 'active' === $this->get('state');
}

/**
Expand Down
1 change: 1 addition & 0 deletions test/src/Provider/GitlabTest.php
Expand Up @@ -173,6 +173,7 @@ public function testUserData()
$this->assertTrue($user->isActive());
$this->assertTrue($user->isAdmin());
$this->assertTrue($user->isExternal());

return $user;
}

Expand Down

0 comments on commit 17d57be

Please sign in to comment.