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": { "require-dev": {
"phpunit/phpunit": "*", "phpunit/phpunit": "*",
"fabpot/php-cs-fixer": "0.4.*@dev",
"fzaninotto/faker": "*" "fzaninotto/faker": "*"
}, },
"keywords": [ "keywords": [

View File

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

View File

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

View File

@ -4,7 +4,6 @@ namespace League\OAuth2\Client\Provider;
use Guzzle\Service\Client as GuzzleClient; use Guzzle\Service\Client as GuzzleClient;
use League\OAuth2\Client\Token\AccessToken as AccessToken; 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\Exception\IDPException as IDPException;
use League\OAuth2\Client\Grant\GrantInterface; use League\OAuth2\Client\Grant\GrantInterface;
@ -93,7 +92,7 @@ abstract class IdentityProvider
throw new \InvalidArgumentException('Unknown grant "'.$grant.'"'); throw new \InvalidArgumentException('Unknown grant "'.$grant.'"');
} }
$grant = new $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'); 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 * Build HTTP the HTTP query, handling PHP version control options
* *
* @param array $params * @param array $params
* @param integer $numeric_prefix * @param integer $numeric_prefix
* @param string $arg_separator * @param string $arg_separator
* @param null|integer $enc_type * @param null|integer $enc_type
* @return string * @return string
*/ */
protected function httpBuildQuery($params, $numeric_prefix = 0, $arg_separator = '&', $enc_type = null) protected function httpBuildQuery($params, $numeric_prefix = 0, $arg_separator = '&', $enc_type = null)
{ {
if(version_compare(PHP_VERSION, '5.4.0', '>=')) { if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
if($enc_type === null) { if ($enc_type === null) {
$enc_type = $this->httpBuildEncType; $enc_type = $this->httpBuildEncType;
} }
$url = http_build_query($params, $numeric_prefix, $arg_separator, $enc_type); $url = http_build_query($params, $numeric_prefix, $arg_separator, $enc_type);
} else { } else {
$url = http_build_query($params, $numeric_prefix, $arg_separator); $url = http_build_query($params, $numeric_prefix, $arg_separator);
} }
return $url; return $url;
} }
protected function fetchUserDetails(AccessToken $token, $force = false) protected function fetchUserDetails(AccessToken $token, $force = false)
{ {
if ( ! $this->cachedUserDetailsResponse || $force == true) { if (! $this->cachedUserDetailsResponse || $force == true) {
$url = $this->urlUserDetails($token); $url = $this->urlUserDetails($token);

View File

@ -35,7 +35,7 @@ class Instagram extends IdentityProvider
return $user; return $user;
} }
public function userUid($response, \League\OAuth2\Client\Token\AccessToken $token) public function userUid($response, \League\OAuth2\Client\Token\AccessToken $token)
{ {
return $response->data->id; return $response->data->id;

View File

@ -29,8 +29,8 @@ class AccessToken
/** /**
* Sets the token, expiry, etc values. * Sets the token, expiry, etc values.
* *
* @param array $options token options * @param array $options token options
* @return void * @return void
*/ */
public function __construct(array $options = null) public function __construct(array $options = null)
{ {
@ -63,7 +63,7 @@ class AccessToken
/** /**
* Returns the token key. * Returns the token key.
* *
* @return string * @return string
*/ */
public function __toString() public function __toString()
{ {
@ -74,7 +74,7 @@ class AccessToken
* Return a boolean if the property is set * Return a boolean if the property is set
* *
* @param string variable name * @param string variable name
* @return bool * @return bool
*/ */
public function __isset($key) public function __isset($key)
{ {