Completed
Push — master ( 8af3b7...bb83e2 )
by Carlos
02:13 queued 47s
created
src/Config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
      */
84 84
     public function has(string $key): bool
85 85
     {
86
-        return (bool) $this->get($key);
86
+        return (bool)$this->get($key);
87 87
     }
88 88
 
89 89
     public function offsetExists($offset)
Please login to merge, or discard this patch.
src/Providers/WeChat.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $query = http_build_query($this->getCodeFields(), '', '&', $this->encodingType);
81 81
 
82
-        return $url . '?' . $query . '#wechat_redirect';
82
+        return $url.'?'.$query.'#wechat_redirect';
83 83
     }
84 84
 
85 85
     protected function getCodeFields(): array
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
     protected function getTokenUrl(): string
102 102
     {
103 103
         if (!empty($this->component)) {
104
-            return $this->baseUrl . '/oauth2/component/access_token';
104
+            return $this->baseUrl.'/oauth2/component/access_token';
105 105
         }
106 106
 
107
-        return $this->baseUrl . '/oauth2/access_token';
107
+        return $this->baseUrl.'/oauth2/access_token';
108 108
     }
109 109
 
110 110
     /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     {
139 139
         $language = $this->withCountryCode ? null : (isset($this->parameters['lang']) ? $this->parameters['lang'] : 'zh_CN');
140 140
 
141
-        $response = $this->getHttpClient()->get($this->baseUrl . '/userinfo', [
141
+        $response = $this->getHttpClient()->get($this->baseUrl.'/userinfo', [
142 142
             'query' => array_filter([
143 143
                 'access_token' => $token,
144 144
                 'openid' => $this->openid,
Please login to merge, or discard this patch.
src/Providers/DingTalk.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         ];
104 104
 
105 105
         $response = $this->getHttpClient()->post(
106
-            $this->getUserByCode . '?' . http_build_query($queryParams),
106
+            $this->getUserByCode.'?'.http_build_query($queryParams),
107 107
             [
108 108
                 'json' => ['tmp_auth_code' => $code],
109 109
             ]
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $response = \json_decode($response->getBody()->getContents(), true);
112 112
 
113 113
         if (0 != $response['errcode']) {
114
-            throw new \InvalidArgumentException('You get error: ' . json_encode($response, JSON_UNESCAPED_UNICODE));
114
+            throw new \InvalidArgumentException('You get error: '.json_encode($response, JSON_UNESCAPED_UNICODE));
115 115
         }
116 116
 
117 117
         return new User(
Please login to merge, or discard this patch.
src/Providers/Facebook.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 
19 19
     protected function getAuthUrl(): string
20 20
     {
21
-        return $this->buildAuthUrlFromBase('https://www.facebook.com/' . $this->version . '/dialog/oauth');
21
+        return $this->buildAuthUrlFromBase('https://www.facebook.com/'.$this->version.'/dialog/oauth');
22 22
     }
23 23
 
24 24
     protected function getTokenUrl(): string
25 25
     {
26
-        return $this->graphUrl . '/oauth/access_token';
26
+        return $this->graphUrl.'/oauth/access_token';
27 27
     }
28 28
 
29 29
     /**
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     protected function getUserByToken(string $token, ?array $query = []): array
55 55
     {
56 56
         $appSecretProof = hash_hmac('sha256', $token, $this->getConfig()->get('client_secret'));
57
-        $endpont = $this->graphUrl . '/' . $this->version . '/me?access_token=' . $token . '&appsecret_proof=' . $appSecretProof . '&fields=' .
57
+        $endpont = $this->graphUrl.'/'.$this->version.'/me?access_token='.$token.'&appsecret_proof='.$appSecretProof.'&fields='.
58 58
             implode(',', $this->fields);
59 59
 
60 60
         $response = $this->getHttpClient()->get(
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     protected function mapUserToObject(array $user): User
73 73
     {
74 74
         $userId = $user['id'] ?? null;
75
-        $avatarUrl = $this->graphUrl . '/' . $this->version . '/' . $userId . '/picture';
75
+        $avatarUrl = $this->graphUrl.'/'.$this->version.'/'.$userId.'/picture';
76 76
 
77 77
         $firstName = $user['first_name'] ?? null;
78 78
         $lastName = $user['last_name'] ?? null;
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
             [
82 82
                 'id' => $user['id'] ?? null,
83 83
                 'nickname' => null,
84
-                'name' => $firstName . ' ' . $lastName,
84
+                'name' => $firstName.' '.$lastName,
85 85
                 'email' => $user['email'] ?? null,
86
-                'avatar' => $userId ? $avatarUrl . '?type=normal' : null,
87
-                'avatar_original' => $userId ? $avatarUrl . '?width=1920' : null,
86
+                'avatar' => $userId ? $avatarUrl.'?type=normal' : null,
87
+                'avatar_original' => $userId ? $avatarUrl.'?width=1920' : null,
88 88
             ]
89 89
         );
90 90
     }
Please login to merge, or discard this patch.
src/Providers/Base.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     {
243 243
         $query = $this->getCodeFields() + ($this->state ? ['state' => $this->state] : []);
244 244
 
245
-        return $url . '?' . \http_build_query($query, '', '&', $this->encodingType);
245
+        return $url.'?'.\http_build_query($query, '', '&', $this->encodingType);
246 246
     }
247 247
 
248 248
     protected function getCodeFields(): array
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         }
284 284
 
285 285
         if (empty($response[$this->accessTokenKey])) {
286
-            throw new AuthorizeFailedException('Authorize Failed: ' . json_encode($response, JSON_UNESCAPED_UNICODE), $response);
286
+            throw new AuthorizeFailedException('Authorize Failed: '.json_encode($response, JSON_UNESCAPED_UNICODE), $response);
287 287
         }
288 288
 
289 289
         return $response + [
Please login to merge, or discard this patch.
src/Providers/DouYin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     protected function getAuthUrl(): string
21 21
     {
22
-        return $this->buildAuthUrlFromBase($this->baseUrl . '/platform/oauth/connect/');
22
+        return $this->buildAuthUrlFromBase($this->baseUrl.'/platform/oauth/connect/');
23 23
     }
24 24
 
25 25
     /**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     protected function getTokenUrl(): string
39 39
     {
40
-        return $this->baseUrl . '/oauth/access_token/';
40
+        return $this->baseUrl.'/oauth/access_token/';
41 41
     }
42 42
 
43 43
     /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     protected function getUserByToken(string $token): array
93 93
     {
94
-        $userUrl = $this->baseUrl . '/oauth/userinfo/';
94
+        $userUrl = $this->baseUrl.'/oauth/userinfo/';
95 95
 
96 96
         if (empty($this->openId)) {
97 97
             throw new InvalidArgumentException('please set open_id before your query.');
Please login to merge, or discard this patch.
src/Providers/WeWork.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $response = \json_decode($response->getBody(), true) ?? [];
138 138
 
139 139
         if (($response['errcode'] ?? 1) > 0 || empty($response['UserId'])) {
140
-            throw new AuthorizeFailedException('Failed to get user openid:' . $response['errmsg'] ?? 'Unknown.', $response);
140
+            throw new AuthorizeFailedException('Failed to get user openid:'.$response['errmsg'] ?? 'Unknown.', $response);
141 141
         }
142 142
 
143 143
         return $response;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $response = \json_decode($response->getBody(), true) ?? [];
165 165
 
166 166
         if (($response['errcode'] ?? 1) > 0 || empty($response['userid'])) {
167
-            throw new AuthorizeFailedException('Failed to get user:' . $response['errmsg'] ?? 'Unknown.', $response);
167
+            throw new AuthorizeFailedException('Failed to get user:'.$response['errmsg'] ?? 'Unknown.', $response);
168 168
         }
169 169
 
170 170
         return \json_decode($response->getBody(), true) ?? [];
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         $response = \json_decode($response->getBody(), true) ?? [];
217 217
 
218 218
         if (($response['errcode'] ?? 1) > 0) {
219
-            throw new AuthorizeFailedException('Failed to get api access_token:' . $response['errmsg'] ?? 'Unknown.', $response);
219
+            throw new AuthorizeFailedException('Failed to get api access_token:'.$response['errmsg'] ?? 'Unknown.', $response);
220 220
         }
221 221
 
222 222
         return $response['access_token'];
Please login to merge, or discard this patch.
src/Providers/Linkedin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,11 +97,11 @@
 block discarded – undo
97 97
         $name = $firstName.' '.$lastName;
98 98
 
99 99
         $images = $user['profilePicture.displayImage~.elements'] ?? [];
100
-        $avatars = array_filter($images, function ($image) {
100
+        $avatars = array_filter($images, function($image) {
101 101
             return $image['data']['com.linkedin.digitalmedia.mediaartifact.StillImage']['storageSize']['width'] === 100;
102 102
         });
103 103
         $avatar = array_shift($avatars);
104
-        $originalAvatars = array_filter($images, function ($image) {
104
+        $originalAvatars = array_filter($images, function($image) {
105 105
             return $image['data']['com.linkedin.digitalmedia.mediaartifact.StillImage']['storageSize']['width'] === 800;
106 106
         });
107 107
         $originalAvatar = array_shift($originalAvatars);
Please login to merge, or discard this patch.
src/Providers/Baidu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected function getAuthUrl(): string
46 46
     {
47
-        return $this->buildAuthUrlFromBase($this->baseUrl . '/oauth/' . $this->version . '/authorize');
47
+        return $this->buildAuthUrlFromBase($this->baseUrl.'/oauth/'.$this->version.'/authorize');
48 48
     }
49 49
 
50 50
     protected function getCodeFields(): array
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     protected function getTokenUrl(): string
65 65
     {
66
-        return $this->baseUrl . '/oauth/' . $this->version . '/token';
66
+        return $this->baseUrl.'/oauth/'.$this->version.'/token';
67 67
     }
68 68
 
69 69
     /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     protected function getUserByToken(string $token): array
85 85
     {
86 86
         $response = $this->getHttpClient()->get(
87
-            $this->baseUrl . '/rest/' . $this->version . '/passport/users/getInfo',
87
+            $this->baseUrl.'/rest/'.$this->version.'/passport/users/getInfo',
88 88
             [
89 89
                 'query' => [
90 90
                     'access_token' => $token,
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                 'nickname' => $user['realname'] ?? null,
112 112
                 'name' => $user['username'] ?? null,
113 113
                 'email' => '',
114
-                'avatar' => $user['portrait'] ? 'http://tb.himg.baidu.com/sys/portraitn/item/' . $user['portrait'] : null,
114
+                'avatar' => $user['portrait'] ? 'http://tb.himg.baidu.com/sys/portraitn/item/'.$user['portrait'] : null,
115 115
             ]
116 116
         );
117 117
     }
Please login to merge, or discard this patch.