Passed
Push — master ( fe732b...b05337 )
by Goffy
02:55
created
class/Github/GithubClient.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
     public function testMilo($url) {
83 83
         $api = new Github\Api;
84
-        $response = $api->get(static::BASE_URL . $url);
84
+        $response = $api->get(static::BASE_URL.$url);
85 85
         $data = $api->decode($response);
86 86
         
87 87
         return $data;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
         $token = new Github\OAuth\Token('{myKey}', 'bearer', ['repo', 'user', 'public_repo']);
94 94
         $api->setToken($token);
95
-        $response = $api->get(static::BASE_URL . $url);
95
+        $response = $api->get(static::BASE_URL.$url);
96 96
 
97 97
         $data = $api->decode($response);
98 98
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function getUserRepositories($username, $per_page = 100, $page = 1)
119 119
     {
120
-        $url = static::BASE_URL . 'users/' . \rawurlencode($username) . '/repos?per_page=' . $per_page . '&page=' . $page;
120
+        $url = static::BASE_URL.'users/'.\rawurlencode($username).'/repos?per_page='.$per_page.'&page='.$page;
121 121
 
122 122
         return $this->_get($url);
123 123
     }
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
      */
133 133
     public function getOrgRepositories($org, $per_page = 100, $page = 1)
134 134
     {
135
-        $url = static::BASE_URL . 'orgs/' . \rawurlencode($org) . '/repos?per_page=' . $per_page . '&page=' . $page;
135
+        $url = static::BASE_URL.'orgs/'.\rawurlencode($org).'/repos?per_page='.$per_page.'&page='.$page;
136 136
 
137 137
         return $this->_get($url);
138 138
     }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public function getReadme($username, $repository)
148 148
     {
149
-        $url = static::BASE_URL . 'repos/' . \rawurlencode($username) . '/' . \rawurlencode($repository) . '/readme';
149
+        $url = static::BASE_URL.'repos/'.\rawurlencode($username).'/'.\rawurlencode($repository).'/readme';
150 150
 
151 151
         return $this->_get($url, true);
152 152
     }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      */
161 161
     public function getReleases($username, $repository)
162 162
     {
163
-        $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases';
163
+        $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases';
164 164
 
165 165
         return $this->_get($url, true);
166 166
     }
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
     public function getLatestRelease($username, $repository, $prerelease = false)
177 177
     {
178 178
         if ($prerelease) {
179
-            $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases';
179
+            $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases';
180 180
         } else {
181
-            $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases/latest';
181
+            $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases/latest';
182 182
         }
183 183
         $result = $this->_get($url);
184 184
 
@@ -223,14 +223,14 @@  discard block
 block discarded – undo
223 223
             } else {
224 224
                 $error = true;
225 225
                 $errMsg = $response->getContent();
226
-                $logsHandler->updateTableLogs(Constants::LOG_TYPE_ERROR, $errMsg, 'ERROR ' . $code);
226
+                $logsHandler->updateTableLogs(Constants::LOG_TYPE_ERROR, $errMsg, 'ERROR '.$code);
227 227
             }
228 228
         }
229 229
         if ($error) {
230 230
             //catch common errors
231 231
             switch ($code) {
232 232
                 case 401:
233
-                    throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_401 . '"');
233
+                    throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_401.'"');
234 234
                     break;
235 235
                 case 403:
236 236
                     /*
@@ -238,21 +238,21 @@  discard block
 block discarded – undo
238 238
                         $GLOBALS['xoopsTpl']->assign('apiexceed', true);
239 239
                     }
240 240
                     */
241
-                    throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_403 . '"');
241
+                    throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_403.'"');
242 242
                     break;
243 243
                 case 404:
244
-                    throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_404 . '"');
244
+                    throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_404.'"');
245 245
                     break;
246 246
                 case 405:
247
-                    throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_405 . '"');
247
+                    throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_405.'"');
248 248
                     break;
249 249
                 case 0:
250 250
                 default:
251
-                    throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API . $errMsg . '"');
251
+                    throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API.$errMsg.'"');
252 252
                     break;
253 253
             }
254 254
         }
255
-        $data = (array)$api->decode($response);
255
+        $data = (array) $api->decode($response);
256 256
 
257 257
         return $data;
258 258
     }
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         $setting = $settingsHandler->getPrimarySetting();
329 329
 
330 330
         if (0 == \count($setting)) {
331
-            \redirect_header(\XOOPS_URL . '/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS);
331
+            \redirect_header(\XOOPS_URL.'/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS);
332 332
         }
333 333
         //$this->userAuth = $setting['user'];
334 334
         $this->tokenAuth = $setting['token'];
Please login to merge, or discard this patch.