From 6387ae33fe1be23a8ceeca7361cfa929b44f5b51 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Wed, 23 Apr 2014 21:34:10 -0700 Subject: [PATCH] Added php-cs-fixer to dev and ran it --- composer.json | 1 + src/Provider/Eventbrite.php | 1 + src/Provider/Google.php | 1 + src/Provider/IdentityProvider.php | 18 +++++++++--------- src/Provider/Instagram.php | 2 +- src/Token/AccessToken.php | 8 ++++---- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index bb65f22..f9e8f76 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ }, "require-dev": { "phpunit/phpunit": "*", + "fabpot/php-cs-fixer": "0.4.*@dev", "fzaninotto/faker": "*" }, "keywords": [ diff --git a/src/Provider/Eventbrite.php b/src/Provider/Eventbrite.php index 023a37c..2aa622a 100644 --- a/src/Provider/Eventbrite.php +++ b/src/Provider/Eventbrite.php @@ -32,6 +32,7 @@ class Eventbrite extends IdentityProvider $user = new User; $user->uid = $response->user->user_id; $user->email = $response->user->email; + return $user; } diff --git a/src/Provider/Google.php b/src/Provider/Google.php index 0498f9e..6024e78 100644 --- a/src/Provider/Google.php +++ b/src/Provider/Google.php @@ -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; } diff --git a/src/Provider/IdentityProvider.php b/src/Provider/IdentityProvider.php index 6822f32..ccd1e84 100644 --- a/src/Provider/IdentityProvider.php +++ b/src/Provider/IdentityProvider.php @@ -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'); } @@ -171,27 +170,28 @@ abstract class IdentityProvider /** * Build HTTP the HTTP query, handling PHP version control options * - * @param array $params - * @param integer $numeric_prefix - * @param string $arg_separator - * @param null|integer $enc_type + * @param array $params + * @param integer $numeric_prefix + * @param string $arg_separator + * @param null|integer $enc_type * @return string */ 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); diff --git a/src/Provider/Instagram.php b/src/Provider/Instagram.php index 84f6e02..512eb5f 100644 --- a/src/Provider/Instagram.php +++ b/src/Provider/Instagram.php @@ -35,7 +35,7 @@ class Instagram extends IdentityProvider return $user; } - + public function userUid($response, \League\OAuth2\Client\Token\AccessToken $token) { return $response->data->id; diff --git a/src/Token/AccessToken.php b/src/Token/AccessToken.php index 7303c56..2710099 100755 --- a/src/Token/AccessToken.php +++ b/src/Token/AccessToken.php @@ -29,8 +29,8 @@ class AccessToken /** * Sets the token, expiry, etc values. * - * @param array $options token options - * @return void + * @param array $options token options + * @return void */ public function __construct(array $options = null) { @@ -63,7 +63,7 @@ class AccessToken /** * Returns the token key. * - * @return string + * @return string */ public function __toString() { @@ -74,7 +74,7 @@ class AccessToken * Return a boolean if the property is set * * @param string variable name - * @return bool + * @return bool */ public function __isset($key) {