@@ -47,15 +47,15 @@ discard block |
||
| 47 | 47 | $options = [ |
| 48 | 48 | 'http' => [ |
| 49 | 49 | 'method' => $request->getMethod(), |
| 50 | - 'header' => implode("\r\n", $headerStr) . "\r\n", |
|
| 51 | - 'follow_location' => 0, # Github sets the Location header for 201 code too and redirection is not required for us |
|
| 50 | + 'header' => implode("\r\n", $headerStr)."\r\n", |
|
| 51 | + 'follow_location' => 0, # Github sets the Location header for 201 code too and redirection is not required for us |
|
| 52 | 52 | 'protocol_version' => 1.1, |
| 53 | 53 | 'ignore_errors' => TRUE, |
| 54 | 54 | ], |
| 55 | 55 | 'ssl' => [ |
| 56 | 56 | 'verify_peer' => TRUE, |
| 57 | - 'cafile' => realpath(__DIR__ . '/../../ca-chain.crt'), |
|
| 58 | - 'disable_compression' => TRUE, # Effective since PHP 5.4.13 |
|
| 57 | + 'cafile' => realpath(__DIR__.'/../../ca-chain.crt'), |
|
| 58 | + 'disable_compression' => TRUE, # Effective since PHP 5.4.13 |
|
| 59 | 59 | ], |
| 60 | 60 | ]; |
| 61 | 61 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $headers = []; |
| 105 | 105 | foreach ($http_response_header as $header) { |
| 106 | 106 | if (in_array(substr($header, 0, 1), [' ', "\t"], TRUE)) { |
| 107 | - $headers[$last] .= ' ' . trim($header); # RFC2616, 2.2 |
|
| 107 | + $headers[$last] .= ' '.trim($header); # RFC2616, 2.2 |
|
| 108 | 108 | } else { |
| 109 | 109 | list($name, $value) = explode(':', $header, 2) + [NULL, NULL]; |
| 110 | 110 | $headers[$last = trim($name)] = trim($value); |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | CURLOPT_CONNECTTIMEOUT => 10, |
| 59 | 59 | CURLOPT_SSL_VERIFYHOST => 2, |
| 60 | 60 | CURLOPT_SSL_VERIFYPEER => 1, |
| 61 | - CURLOPT_CAINFO => realpath(__DIR__ . '/../ca-chain.crt'), |
|
| 61 | + CURLOPT_CAINFO => realpath(__DIR__.'/../ca-chain.crt'), |
|
| 62 | 62 | ]; |
| 63 | 63 | |
| 64 | 64 | $hardOptions = [ |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $responseHeaders = []; |
| 79 | 79 | |
| 80 | 80 | } elseif (in_array(substr($line, 0, 1), [' ', "\t"], TRUE)) { |
| 81 | - $responseHeaders[$last] .= ' ' . trim($line); # RFC2616, 2.2 |
|
| 81 | + $responseHeaders[$last] .= ' '.trim($line); # RFC2616, 2.2 |
|
| 82 | 82 | |
| 83 | 83 | } elseif ($line !== "\r\n") { |
| 84 | 84 | list($name, $value) = explode(':', $line, 2); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | $result = curl_setopt_array($this->curl, $hardOptions + ($this->options ?: []) + $softOptions); |
| 104 | 104 | if ($result === FALSE) { |
| 105 | - throw new BadResponseException('Setting cURL options failed: ' . curl_error($this->curl), curl_errno($this->curl)); |
|
| 105 | + throw new BadResponseException('Setting cURL options failed: '.curl_error($this->curl), curl_errno($this->curl)); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $content = curl_exec($this->curl); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE); |
| 114 | 114 | if ($code === FALSE) { |
| 115 | - throw new BadResponseException('HTTP status code is missing:' . curl_error($this->curl), curl_errno($this->curl)); |
|
| 115 | + throw new BadResponseException('HTTP status code is missing:'.curl_error($this->curl), curl_errno($this->curl)); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | return new Response($code, $responseHeaders, $content); |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | |
| 65 | 65 | $this->storage->set('auth.state', $state); |
| 66 | 66 | |
| 67 | - $url = $this->authUrl . '?' . http_build_query($params); |
|
| 67 | + $url = $this->authUrl.'?'.http_build_query($params); |
|
| 68 | 68 | if ($redirectCb === NULL) { |
| 69 | 69 | header("Location: $url"); |
| 70 | 70 | die(); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | throw new MissingDirectoryException("Directory '$tempDir' is missing."); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - $dir = $tempDir . DIRECTORY_SEPARATOR . 'milo.github-api'; |
|
| 30 | + $dir = $tempDir.DIRECTORY_SEPARATOR.'milo.github-api'; |
|
| 31 | 31 | |
| 32 | 32 | if (!is_dir($dir)) { |
| 33 | 33 | set_error_handler(function($severity, $message, $file, $line) use ($dir, & $valid) { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | private function filePath($key) |
| 93 | 93 | { |
| 94 | - return $this->dir . DIRECTORY_SEPARATOR . sha1($key) . '.php'; |
|
| 94 | + return $this->dir.DIRECTORY_SEPARATOR.sha1($key).'.php'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function getUserRepositories($username, $per_page = 100, $page = 1) |
| 112 | 112 | { |
| 113 | - $url = static::BASE_URL . 'users/' . \rawurlencode($username) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
| 113 | + $url = static::BASE_URL.'users/'.\rawurlencode($username).'/repos?per_page='.$per_page.'&page='.$page; |
|
| 114 | 114 | |
| 115 | 115 | return $this->_get($url); |
| 116 | 116 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function getOrgRepositories($org, $per_page = 100, $page = 1) |
| 127 | 127 | { |
| 128 | - $url = static::BASE_URL . 'orgs/' . \rawurlencode($org) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
| 128 | + $url = static::BASE_URL.'orgs/'.\rawurlencode($org).'/repos?per_page='.$per_page.'&page='.$page; |
|
| 129 | 129 | |
| 130 | 130 | return $this->_get($url); |
| 131 | 131 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function getReadme($username, $repository) |
| 144 | 144 | { |
| 145 | - $url = static::BASE_URL . 'repos/' . \rawurlencode($username) . '/' . \rawurlencode($repository) . '/readme'; |
|
| 145 | + $url = static::BASE_URL.'repos/'.\rawurlencode($username).'/'.\rawurlencode($repository).'/readme'; |
|
| 146 | 146 | |
| 147 | 147 | return $this->_get($url, false, false); |
| 148 | 148 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public function getReleases($user, $repository) |
| 158 | 158 | { |
| 159 | - $url = static::BASE_URL . 'repos/' . $user . '/' . $repository . '/releases'; |
|
| 159 | + $url = static::BASE_URL.'repos/'.$user.'/'.$repository.'/releases'; |
|
| 160 | 160 | |
| 161 | 161 | return $this->_get($url); |
| 162 | 162 | } |
@@ -172,9 +172,9 @@ discard block |
||
| 172 | 172 | public function getLatestRelease($user, $repository, $prerelease = false) |
| 173 | 173 | { |
| 174 | 174 | if ($prerelease) { |
| 175 | - $url = static::BASE_URL . 'repos/' . $user . '/' . $repository . '/releases'; |
|
| 175 | + $url = static::BASE_URL.'repos/'.$user.'/'.$repository.'/releases'; |
|
| 176 | 176 | } else { |
| 177 | - $url = static::BASE_URL . 'repos/' . $user . '/' . $repository . '/releases/latest'; |
|
| 177 | + $url = static::BASE_URL.'repos/'.$user.'/'.$repository.'/releases/latest'; |
|
| 178 | 178 | } |
| 179 | 179 | $result = $this->_get($url); |
| 180 | 180 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $api->setToken($token); |
| 200 | 200 | $request = $api->createRequest('GET', $url, [], [], ''); |
| 201 | 201 | $response = $api->request($request); |
| 202 | - $data = (array)$api->decode($response); |
|
| 202 | + $data = (array) $api->decode($response); |
|
| 203 | 203 | |
| 204 | 204 | return $data; |
| 205 | 205 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $setting = $settingsHandler->getPrimarySetting(); |
| 217 | 217 | |
| 218 | 218 | if (0 == \count($setting)) { |
| 219 | - \redirect_header(\XOOPS_URL . '/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
| 219 | + \redirect_header(\XOOPS_URL.'/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
| 220 | 220 | } |
| 221 | 221 | $this->userAuth = $setting['user']; |
| 222 | 222 | $this->tokenAuth = $setting['token']; |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | $editorMaxchar = $helper->getConfig('editor_maxchar'); |
| 123 | 123 | $ret = $this->getValues($keys, $format, $maxDepth); |
| 124 | 124 | $ret['id'] = $this->getVar('log_id'); |
| 125 | - $ret['type'] = $this->getVar('log_type'); |
|
| 125 | + $ret['type'] = $this->getVar('log_type'); |
|
| 126 | 126 | switch ($ret['type']) { |
| 127 | 127 | case Constants::LOG_TYPE_NONE: |
| 128 | 128 | default: |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | public const PERM_README_UPDATE = 3; |
| 53 | 53 | |
| 54 | 54 | // Constants for log type |
| 55 | - public const LOG_TYPE_NONE = 0; |
|
| 55 | + public const LOG_TYPE_NONE = 0; |
|
| 56 | 56 | public const LOG_TYPE_UPDATE_START = 1; |
| 57 | 57 | public const LOG_TYPE_UPDATE_END = 2; |
| 58 | 58 | public const LOG_TYPE_REQUEST = 3; |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | $logsObj->setVar('log_type', $type); |
| 143 | 143 | $logsObj->setVar('log_details', $detail); |
| 144 | 144 | $logsObj->setVar('log_result', $result); |
| 145 | - $logsObj->setVar('log_datecreated',time()); |
|
| 145 | + $logsObj->setVar('log_datecreated', time()); |
|
| 146 | 146 | $logsObj->setVar('log_submitter', $submitter); |
| 147 | 147 | // Insert Data |
| 148 | 148 | if ($logsHandler->insert($logsObj)) { |