@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | $data = new Data\Collection($response); |
| 53 | 53 | |
| 54 | - if (!$data->exists('data')) { |
|
| 54 | + if ( ! $data->exists('data')) { |
|
| 55 | 55 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | $data = new Data\Collection($response); |
| 53 | 53 | |
| 54 | - if (!$data->exists('id')) { |
|
| 54 | + if ( ! $data->exists('id')) { |
|
| 55 | 55 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | $data = new Data\Collection($response); |
| 53 | 53 | |
| 54 | - if (!$data->exists('user_id')) { |
|
| 54 | + if ( ! $data->exists('user_id')) { |
|
| 55 | 55 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $response = (new Data\Parser())->parse($res); |
| 91 | 91 | |
| 92 | - if (!isset($response->openid)) { |
|
| 92 | + if ( ! isset($response->openid)) { |
|
| 93 | 93 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $data = new Data\Collection($response); |
| 117 | 117 | |
| 118 | 118 | if ($data->get('ret') < 0) { |
| 119 | - throw new UnexpectedApiResponseException('Provider API returned an error: ' . $data->get('msg')); |
|
| 119 | + throw new UnexpectedApiResponseException('Provider API returned an error: '.$data->get('msg')); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $userProfile = new Profile(); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $data = new Data\Collection($response); |
| 54 | 54 | |
| 55 | - if (!$data->exists('id')) { |
|
| 55 | + if ( ! $data->exists('id')) { |
|
| 56 | 56 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -95,10 +95,10 @@ discard block |
||
| 95 | 95 | $response = $this->apiRequest('user/emails'); |
| 96 | 96 | |
| 97 | 97 | foreach ($response as $idx => $item) { |
| 98 | - if (!empty($item->primary) && $item->primary == 1) { |
|
| 98 | + if ( ! empty($item->primary) && $item->primary == 1) { |
|
| 99 | 99 | $userProfile->email = $item->email; |
| 100 | 100 | |
| 101 | - if (!empty($item->verified) && $item->verified == 1) { |
|
| 101 | + if ( ! empty($item->verified) && $item->verified == 1) { |
|
| 102 | 102 | $userProfile->emailVerified = $userProfile->email; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $obj_dump = print_r($object, true); |
| 50 | 50 | |
| 51 | 51 | // phpcs:ignore |
| 52 | - $html .= sprintf('<b>' . get_class($object) . '</b> extends <b>' . get_parent_class($object) . '</b><pre>%s</pre>', $obj_dump); |
|
| 52 | + $html .= sprintf('<b>'.get_class($object).'</b> extends <b>'.get_parent_class($object).'</b><pre>%s</pre>', $obj_dump); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | $html .= '<h2>Session</h2>'; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $data = new Data\Collection($response); |
| 54 | 54 | |
| 55 | - if (!$data->exists('ok') || !$data->get('ok')) { |
|
| 55 | + if ( ! $data->exists('ok') || ! $data->get('ok')) { |
|
| 56 | 56 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | $maxSize = 0; |
| 88 | 88 | foreach ($data->filter('user')->properties() as $property) { |
| 89 | 89 | if (preg_match('/^image_(\d+)$/', $property, $matches) === 1) { |
| 90 | - $availableSize = (int)$matches[1]; |
|
| 90 | + $availableSize = (int) $matches[1]; |
|
| 91 | 91 | if ($maxSize < $availableSize) { |
| 92 | 92 | $maxSize = $availableSize; |
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | if ($maxSize > 0) { |
| 97 | - return $data->filter('user')->get('image_' . $maxSize); |
|
| 97 | + return $data->filter('user')->get('image_'.$maxSize); |
|
| 98 | 98 | } |
| 99 | 99 | return null; |
| 100 | 100 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $data = new Data\Collection($response); |
| 67 | 67 | |
| 68 | - if (!$data->exists('id')) { |
|
| 68 | + if ( ! $data->exists('id')) { |
|
| 69 | 69 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | if ($data->get('avatar')) { |
| 89 | 89 | $userProfile->photoURL = 'https://cdn.discordapp.com/avatars/'; |
| 90 | - $userProfile->photoURL .= $data->get('id') . '/' . $data->get('avatar') . '.png'; |
|
| 90 | + $userProfile->photoURL .= $data->get('id').'/'.$data->get('avatar').'.png'; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | return $userProfile; |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | $data = new Data\Collection($response); |
| 53 | 53 | |
| 54 | - if (!$data->exists('account_id') || !$data->get('account_id')) { |
|
| 54 | + if ( ! $data->exists('account_id') || ! $data->get('account_id')) { |
|
| 55 | 55 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
| 56 | 56 | } |
| 57 | 57 | |