@@ -100,7 +100,7 @@ |
||
| 100 | 100 | */ |
| 101 | 101 | public function has($key) |
| 102 | 102 | { |
| 103 | - return (bool) $this->get($key); |
|
| 103 | + return (bool)$this->get($key); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | /** |
| 111 | 111 | * 格式化token. |
| 112 | 112 | * |
| 113 | - * @param \Psr\Http\Message\StreamInterface|array $body |
|
| 113 | + * @param string $body |
|
| 114 | 114 | * |
| 115 | 115 | * @return \Overtrue\Socialite\AccessTokenInterface |
| 116 | 116 | */ |
@@ -230,6 +230,7 @@ |
||
| 230 | 230 | |
| 231 | 231 | /** |
| 232 | 232 | * {@inheritdoc}. |
| 233 | + * @param string $url |
|
| 233 | 234 | */ |
| 234 | 235 | protected function getUserInfoUrl($url, AccessTokenInterface $token) |
| 235 | 236 | { |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | ], |
| 102 | 102 | ]); |
| 103 | 103 | |
| 104 | - return (array) json_decode($response->getBody(), true); |
|
| 104 | + return (array)json_decode($response->getBody(), true); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | ], |
| 123 | 123 | ]); |
| 124 | 124 | |
| 125 | - return (array) $this->arrayItem(json_decode($response->getBody(), true), 'elements.0.handle~'); |
|
| 125 | + return (array)$this->arrayItem(json_decode($response->getBody(), true), 'elements.0.handle~'); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -135,12 +135,12 @@ discard block |
||
| 135 | 135 | $lastName = $this->arrayItem($user, 'lastName.localized.'.$preferredLocale); |
| 136 | 136 | $name = $firstName.' '.$lastName; |
| 137 | 137 | |
| 138 | - $images = (array) $this->arrayItem($user, 'profilePicture.displayImage~.elements', []); |
|
| 139 | - $avatars = array_filter($images, function ($image) { |
|
| 138 | + $images = (array)$this->arrayItem($user, 'profilePicture.displayImage~.elements', []); |
|
| 139 | + $avatars = array_filter($images, function($image) { |
|
| 140 | 140 | return $image['data']['com.linkedin.digitalmedia.mediaartifact.StillImage']['storageSize']['width'] === 100; |
| 141 | 141 | }); |
| 142 | 142 | $avatar = array_shift($avatars); |
| 143 | - $originalAvatars = array_filter($images, function ($image) { |
|
| 143 | + $originalAvatars = array_filter($images, function($image) { |
|
| 144 | 144 | return $image['data']['com.linkedin.digitalmedia.mediaartifact.StillImage']['storageSize']['width'] === 800; |
| 145 | 145 | }); |
| 146 | 146 | $originalAvatar = array_shift($originalAvatars); |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | * |
| 62 | 62 | * @param string $code |
| 63 | 63 | * |
| 64 | - * @return string |
|
| 64 | + * @return AccessTokenInterface |
|
| 65 | 65 | */ |
| 66 | 66 | public function getAccessToken($code) |
| 67 | 67 | { |
@@ -91,6 +91,7 @@ discard block |
||
| 91 | 91 | /** |
| 92 | 92 | * 获取 app_access_token 接口参数. |
| 93 | 93 | * |
| 94 | + * @param string $code |
|
| 94 | 95 | * @return array |
| 95 | 96 | */ |
| 96 | 97 | protected function getTokenFields($code) |
@@ -104,7 +105,7 @@ discard block |
||
| 104 | 105 | /** |
| 105 | 106 | * 格式化 token. |
| 106 | 107 | * |
| 107 | - * @param \Psr\Http\Message\StreamInterface|array $body |
|
| 108 | + * @param string $body |
|
| 108 | 109 | * |
| 109 | 110 | * @return \Overtrue\Socialite\AccessTokenInterface |
| 110 | 111 | */ |
@@ -125,7 +126,7 @@ discard block |
||
| 125 | 126 | /** |
| 126 | 127 | * 获取用户信息. |
| 127 | 128 | * |
| 128 | - * @return array|mixed |
|
| 129 | + * @return User |
|
| 129 | 130 | */ |
| 130 | 131 | public function user(AccessTokenInterface $token = null) |
| 131 | 132 | { |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /** |
| 358 | - * @return array |
|
| 358 | + * @return Config |
|
| 359 | 359 | */ |
| 360 | 360 | public function getConfig() |
| 361 | 361 | { |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | /** |
| 550 | 550 | * Put state to session storage and return it. |
| 551 | 551 | * |
| 552 | - * @return string|bool |
|
| 552 | + * @return false|string |
|
| 553 | 553 | */ |
| 554 | 554 | protected function makeState() |
| 555 | 555 | { |