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');
}
@ -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);

View File

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

View File

@ -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)
{