@@ -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 |
@@ -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 |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | */ |
16 | 16 | class Logger implements LoggerInterface |
17 | 17 | { |
18 | - const NONE = 'none'; // turn logging off |
|
18 | + const NONE = 'none'; // turn logging off |
|
19 | 19 | const DEBUG = 'debug'; // debug, info and error messages |
20 | - const INFO = 'info'; // info and error messages |
|
20 | + const INFO = 'info'; // info and error messages |
|
21 | 21 | const ERROR = 'error'; // only error messages |
22 | 22 | |
23 | 23 | /** |
@@ -63,15 +63,15 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected function initialize($file) |
65 | 65 | { |
66 | - if (!$file) { |
|
66 | + if ( ! $file) { |
|
67 | 67 | throw new InvalidArgumentException('Log file is not specified.'); |
68 | 68 | } |
69 | 69 | |
70 | - if (!file_exists($file) && !touch($file)) { |
|
70 | + if ( ! file_exists($file) && ! touch($file)) { |
|
71 | 71 | throw new RuntimeException(sprintf('Log file %s can not be created.', $file)); |
72 | 72 | } |
73 | 73 | |
74 | - if (!is_writable($file)) { |
|
74 | + if ( ! is_writable($file)) { |
|
75 | 75 | throw new RuntimeException(sprintf('Log file %s is not writeable.', $file)); |
76 | 76 | } |
77 | 77 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function info($message, array $context = []) |
83 | 83 | { |
84 | - if (!in_array($this->level, [self::DEBUG, self::INFO])) { |
|
84 | + if ( ! in_array($this->level, [self::DEBUG, self::INFO])) { |
|
85 | 85 | return; |
86 | 86 | } |
87 | 87 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function debug($message, array $context = []) |
95 | 95 | { |
96 | - if (!in_array($this->level, [self::DEBUG])) { |
|
96 | + if ( ! in_array($this->level, [self::DEBUG])) { |
|
97 | 97 | return; |
98 | 98 | } |
99 | 99 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function error($message, array $context = []) |
107 | 107 | { |
108 | - if (!in_array($this->level, [self::DEBUG, self::INFO, self::ERROR])) { |
|
108 | + if ( ! in_array($this->level, [self::DEBUG, self::INFO, self::ERROR])) { |
|
109 | 109 | return; |
110 | 110 | } |
111 | 111 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $datetime = $datetime->format(DATE_ATOM); |
122 | 122 | |
123 | 123 | $content = sprintf('%s -- %s -- %s -- %s', $level, $_SERVER['REMOTE_ADDR'], $datetime, $message); |
124 | - $content .= ($context ? "\n" . print_r($context, true) : ''); |
|
124 | + $content .= ($context ? "\n".print_r($context, true) : ''); |
|
125 | 125 | $content .= "\n"; |
126 | 126 | |
127 | 127 | file_put_contents($this->file, $content, FILE_APPEND); |