Skip to content

Commit

Permalink
CS.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Dec 5, 2015
1 parent 65bebb1 commit c5c50f8
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function __toString()
/**
* {@inheritdoc}
*/
function jsonSerialize()
public function jsonSerialize()
{
return $this->getToken();
}
Expand Down
2 changes: 1 addition & 1 deletion src/AttributeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getAttributes()
* Return the extra attribute.
*
* @param string $name
* @param null $default
* @param string $default
*
* @return mixed
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Providers/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ protected function getTokenFields($code)
/**
* Get the access token from the token response body.
*
* @param string $body
* @param \Psr\Http\Message\StreamInterface $body
*
* @return \Overtrue\Socialite\AccessToken
*/
protected function parseAccessToken($body)
{
return new AccessToken((array)json_decode($body, true));
return new AccessToken((array) json_decode($body, true));
}

/**
Expand Down Expand Up @@ -399,7 +399,7 @@ public function arrayItem(array $array, $key, $default = null)
}

foreach (explode('.', $key) as $segment) {
if (! is_array($array) || ! array_key_exists($segment, $array)) {
if (!is_array($array) || !array_key_exists($segment, $array)) {
return $default;
}

Expand Down
15 changes: 12 additions & 3 deletions src/Providers/DoubanProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<?php

/*
* This file is part of the overtrue/socialite.
*
* (c) overtrue <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

/**
* DoubanProvider.php
* DoubanProvider.php.
*
* This file is part of the socialite.
*
Expand All @@ -16,7 +26,6 @@
use Overtrue\Socialite\ProviderInterface;
use Overtrue\Socialite\User;


/**
* Class DoubanProvider.
*
Expand Down Expand Up @@ -87,4 +96,4 @@ public function getAccessToken($code)

return $this->parseAccessToken($response->getBody()->getContents());
}
}
}
4 changes: 2 additions & 2 deletions src/Providers/QQProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected function getUserByToken(AccessTokenInterface $token)
'oauth_consumer_key' => $this->clientId,
];

$response = $this->getHttpClient()->get($this->baseUrl."/user/get_user_info?".http_build_query($queries));
$response = $this->getHttpClient()->get($this->baseUrl.'/user/get_user_info?'.http_build_query($queries));

return json_decode($this->removeCallback($response->getBody()->getContents()), true);
}
Expand All @@ -160,7 +160,7 @@ protected function mapUserToObject(array $user)
/**
* Remove the fucking callback parentheses.
*
* @param mixed $response
* @param string $response
*
* @return string
*/
Expand Down
4 changes: 2 additions & 2 deletions src/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getAvatar()
/**
* Set the token on the user.
*
* @param string $token
* @param \Overtrue\Socialite\AccessTokenInterface $token
*
* @return $this
*/
Expand All @@ -113,7 +113,7 @@ public function getToken()
}

/**
* Alias of getToken()
* Alias of getToken().
*
* @return \Overtrue\Socialite\AccessToken
*/
Expand Down

0 comments on commit c5c50f8

Please sign in to comment.