Added php-cs-fixer to dev and ran it

1.0
Tom Anderson 2014-04-23 21:34:10 -07:00
parent 399a6167c4
commit 6387ae33fe
6 changed files with 17 additions and 14 deletions

View File

@ -8,6 +8,7 @@
},
"require-dev": {
"phpunit/phpunit": "*",
"fabpot/php-cs-fixer": "0.4.*@dev",
"fzaninotto/faker": "*"
},
"keywords": [

View File

@ -32,6 +32,7 @@ class Eventbrite extends IdentityProvider
$user = new User;
$user->uid = $response->user->user_id;
$user->email = $response->user->email;
return $user;
}

View File

@ -36,6 +36,7 @@ class Google extends IdentityProvider
$user->lastName = $response['family_name'];
$user->email = $response['email'];
$user->imageUrl = (isset($response['picture'])) ? $response['picture'] : null;
return $user;
}

View File

@ -4,7 +4,6 @@ namespace League\OAuth2\Client\Provider;
use Guzzle\Service\Client as GuzzleClient;
use League\OAuth2\Client\Token\AccessToken as AccessToken;
use League\OAuth2\Client\Token\Authorize as AuthorizeToken;
use League\OAuth2\Client\Exception\IDPException as IDPException;
use League\OAuth2\Client\Grant\GrantInterface;
@ -93,7 +92,7 @@ abstract class IdentityProvider
throw new \InvalidArgumentException('Unknown grant "'.$grant.'"');
}
$grant = new $grant;
} elseif ( ! $grant instanceof GrantInterface) {
} elseif (! $grant instanceof GrantInterface) {
throw new \InvalidArgumentException($grant.' is not an instance of League\OAuth2\Client\Grant\GrantInterface');
}
@ -179,19 +178,20 @@ abstract class IdentityProvider
*/
protected function httpBuildQuery($params, $numeric_prefix = 0, $arg_separator = '&', $enc_type = null)
{
if(version_compare(PHP_VERSION, '5.4.0', '>=')) {
if($enc_type === null) {
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
if ($enc_type === null) {
$enc_type = $this->httpBuildEncType;
}
$url = http_build_query($params, $numeric_prefix, $arg_separator, $enc_type);
} else {
$url = http_build_query($params, $numeric_prefix, $arg_separator);
}
return $url;
}
protected function fetchUserDetails(AccessToken $token, $force = false)
{
if ( ! $this->cachedUserDetailsResponse || $force == true) {
if (! $this->cachedUserDetailsResponse || $force == true) {
$url = $this->urlUserDetails($token);