@@ -78,7 +78,7 @@ |
||
78 | 78 | ($this->onProgress)(); |
79 | 79 | |
80 | 80 | $chunk = $this->doRead(); |
81 | - $chunk->onResolve(function ($e, $data) { |
|
81 | + $chunk->onResolve(function($e, $data) { |
|
82 | 82 | if (null !== $data) { |
83 | 83 | $this->uploaded = \strlen($data); |
84 | 84 | } else { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | 'auth_ntlm' => null, // array|string - an array containing the username as first value, and optionally the |
42 | 42 | // password as the second one; or string like username:password - enabling NTLM auth |
43 | 43 | 'extra' => [ |
44 | - 'curl' => [], // A list of extra curl options indexed by their corresponding CURLOPT_* |
|
44 | + 'curl' => [], // A list of extra curl options indexed by their corresponding CURLOPT_* |
|
45 | 45 | ], |
46 | 46 | ]; |
47 | 47 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | return; |
98 | 98 | } |
99 | 99 | |
100 | - curl_multi_setopt($this->multi->handle, \CURLMOPT_PUSHFUNCTION, function ($parent, $pushed, array $requestHeaders) use ($maxPendingPushes) { |
|
100 | + curl_multi_setopt($this->multi->handle, \CURLMOPT_PUSHFUNCTION, function($parent, $pushed, array $requestHeaders) use ($maxPendingPushes) { |
|
101 | 101 | return $this->handlePush($parent, $pushed, $requestHeaders, $maxPendingPushes); |
102 | 102 | }); |
103 | 103 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } else { |
244 | 244 | $eof = false; |
245 | 245 | $buffer = ''; |
246 | - $curlopts[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body, &$buffer, &$eof) { |
|
246 | + $curlopts[\CURLOPT_READFUNCTION] = static function($ch, $fd, $length) use ($body, &$buffer, &$eof) { |
|
247 | 247 | return self::readRequestBody($length, $body, $buffer, $eof); |
248 | 248 | }; |
249 | 249 | } |
@@ -473,18 +473,18 @@ discard block |
||
473 | 473 | $redirectHeaders = []; |
474 | 474 | if (0 < $options['max_redirects']) { |
475 | 475 | $redirectHeaders['host'] = $host; |
476 | - $redirectHeaders['with_auth'] = $redirectHeaders['no_auth'] = \array_filter($options['headers'], static function ($h) { |
|
476 | + $redirectHeaders['with_auth'] = $redirectHeaders['no_auth'] = \array_filter($options['headers'], static function($h) { |
|
477 | 477 | return 0 !== stripos($h, 'Host:'); |
478 | 478 | }); |
479 | 479 | |
480 | 480 | if (isset($options['normalized_headers']['authorization'][0]) || isset($options['normalized_headers']['cookie'][0])) { |
481 | - $redirectHeaders['no_auth'] = \array_filter($options['headers'], static function ($h) { |
|
481 | + $redirectHeaders['no_auth'] = \array_filter($options['headers'], static function($h) { |
|
482 | 482 | return 0 !== stripos($h, 'Authorization:') && 0 !== stripos($h, 'Cookie:'); |
483 | 483 | }); |
484 | 484 | } |
485 | 485 | } |
486 | 486 | |
487 | - return static function ($ch, string $location) use ($redirectHeaders) { |
|
487 | + return static function($ch, string $location) use ($redirectHeaders) { |
|
488 | 488 | try { |
489 | 489 | $location = self::parseUrl($location); |
490 | 490 | } catch (InvalidArgumentException $e) { |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | |
505 | 505 | private function findConstantName($opt): ?string |
506 | 506 | { |
507 | - $constants = \array_filter(get_defined_constants(), static function ($v, $k) use ($opt) { |
|
507 | + $constants = \array_filter(get_defined_constants(), static function($v, $k) use ($opt) { |
|
508 | 508 | return $v === $opt && 'C' === $k[0] && (0 === \strpos($k, 'CURLOPT_') || 0 === \strpos($k, 'CURLINFO_')); |
509 | 509 | }, \ARRAY_FILTER_USE_BOTH); |
510 | 510 |
@@ -136,7 +136,7 @@ |
||
136 | 136 | return new ResponseStream(MockResponse::stream($mockResponses, $timeout)); |
137 | 137 | } |
138 | 138 | |
139 | - return new ResponseStream((function () use ($mockResponses, $clientResponses, $timeout) { |
|
139 | + return new ResponseStream((function() use ($mockResponses, $clientResponses, $timeout) { |
|
140 | 140 | yield from MockResponse::stream($mockResponses, $timeout); |
141 | 141 | yield $this->client->stream($clientResponses, $timeout); |
142 | 142 | })()); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $buffer = $options['buffer'] ?? true; |
47 | 47 | |
48 | 48 | if ($buffer instanceof \Closure) { |
49 | - $options['buffer'] = static function (array $headers) use ($buffer) { |
|
49 | + $options['buffer'] = static function(array $headers) use ($buffer) { |
|
50 | 50 | if (!\is_bool($buffer = $buffer($headers))) { |
51 | 51 | if (!\is_array($bufferInfo = @stream_get_meta_data($buffer))) { |
52 | 52 | throw new \LogicException(\sprintf('The closure passed as option "buffer" must return bool or stream resource, got "%s".', get_debug_type($buffer))); |
@@ -287,8 +287,8 @@ discard block |
||
287 | 287 | return $body; |
288 | 288 | } |
289 | 289 | |
290 | - $generatorToCallable = static function (\Generator $body): \Closure { |
|
291 | - return static function () use ($body) { |
|
290 | + $generatorToCallable = static function(\Generator $body): \Closure { |
|
291 | + return static function() use ($body) { |
|
292 | 292 | while ($body->valid()) { |
293 | 293 | $chunk = $body->current(); |
294 | 294 | $body->next(); |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | |
309 | 309 | if ($body instanceof \Traversable) { |
310 | - return $generatorToCallable((static function ($body) { yield from $body; })($body)); |
|
310 | + return $generatorToCallable((static function($body) { yield from $body; })($body)); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | if ($body instanceof \Closure) { |
@@ -477,11 +477,11 @@ discard block |
||
477 | 477 | |
478 | 478 | if (false !== \strpos($parts[$part], '%')) { |
479 | 479 | // https://tools.ietf.org/html/rfc3986#section-2.3 |
480 | - $parts[$part] = preg_replace_callback('/%(?:2[DE]|3[0-9]|[46][1-9A-F]|5F|[57][0-9A]|7E)++/i', function ($m) { return rawurldecode($m[0]); }, $parts[$part]); |
|
480 | + $parts[$part] = preg_replace_callback('/%(?:2[DE]|3[0-9]|[46][1-9A-F]|5F|[57][0-9A]|7E)++/i', function($m) { return rawurldecode($m[0]); }, $parts[$part]); |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | // https://tools.ietf.org/html/rfc3986#section-3.3 |
484 | - $parts[$part] = preg_replace_callback("#[^-A-Za-z0-9._~!$&/'()*+,;=:@%]++#", function ($m) { return rawurlencode($m[0]); }, $parts[$part]); |
|
484 | + $parts[$part] = preg_replace_callback("#[^-A-Za-z0-9._~!$&/'()*+,;=:@%]++#", function($m) { return rawurlencode($m[0]); }, $parts[$part]); |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | return [ |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $content = ''; |
57 | 57 | $firstChunk = null; |
58 | 58 | |
59 | - return new AsyncResponse($this->client, $method, $url, $options, function (ChunkInterface $chunk, AsyncContext $context) use ($method, $url, $options, &$retryCount, &$content, &$firstChunk) { |
|
59 | + return new AsyncResponse($this->client, $method, $url, $options, function(ChunkInterface $chunk, AsyncContext $context) use ($method, $url, $options, &$retryCount, &$content, &$firstChunk) { |
|
60 | 60 | $exception = null; |
61 | 61 | try { |
62 | 62 | if ($chunk->isTimeout() || null !== $chunk->getInformationalStatus()) { |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | use XoopsModules\Wggithub\Constants; |
26 | 26 | use XoopsModules\Wggithub\Common; |
27 | 27 | |
28 | -require __DIR__ . '/header.php'; |
|
28 | +require __DIR__.'/header.php'; |
|
29 | 29 | $GLOBALS['xoopsOption']['template_main'] = 'wggithub_directories.tpl'; |
30 | -include_once \XOOPS_ROOT_PATH . '/header.php'; |
|
30 | +include_once \XOOPS_ROOT_PATH.'/header.php'; |
|
31 | 31 | |
32 | 32 | $op = Request::getCmd('op', 'list'); |
33 | 33 | $start = Request::getInt('start', 0); |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | unset($directories); |
71 | 71 | // Display Navigation |
72 | 72 | if ($directoriesCount > $limit) { |
73 | - include_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
74 | - $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
73 | + include_once \XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
74 | + $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
75 | 75 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
76 | 76 | } |
77 | 77 | $GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type')); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $xoBreadcrumbs[] = ['title' => \_MA_WGGITHUB_DIRECTORIES]; |
86 | 86 | |
87 | 87 | // Keywords |
88 | -wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords)); |
|
88 | +wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords)); |
|
89 | 89 | unset($keywords); |
90 | 90 | |
91 | 91 | // Description |
@@ -93,4 +93,4 @@ discard block |
||
93 | 93 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/directories.php'); |
94 | 94 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
95 | 95 | |
96 | -require __DIR__ . '/footer.php'; |
|
96 | +require __DIR__.'/footer.php'; |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | Github\Releases |
31 | 31 | }; |
32 | 32 | |
33 | -require __DIR__ . '/header.php'; |
|
33 | +require __DIR__.'/header.php'; |
|
34 | 34 | $GLOBALS['xoopsOption']['template_main'] = 'wggithub_index.tpl'; |
35 | -include_once \XOOPS_ROOT_PATH . '/header.php'; |
|
35 | +include_once \XOOPS_ROOT_PATH.'/header.php'; |
|
36 | 36 | |
37 | 37 | $op = Request::getCmd('op', 'list'); |
38 | 38 | $filterRelease = Request::getCmd('release', 'all'); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | // Define Stylesheet |
45 | 45 | $GLOBALS['xoTheme']->addStylesheet($style, null); |
46 | -$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL . '/assets/css/tabs.css', null); |
|
46 | +$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL.'/assets/css/tabs.css', null); |
|
47 | 47 | $keywords = []; |
48 | 48 | // |
49 | 49 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | foreach (\array_keys($directoriesAll) as $i) { |
110 | 110 | $directories[$i] = $directoriesAll[$i]->getValuesDirectories(); |
111 | 111 | $dirName = $directoriesAll[$i]->getVar('dir_name'); |
112 | - $dirFilterRelease = (bool)$directoriesAll[$i]->getVar('dir_filterrelease'); |
|
112 | + $dirFilterRelease = (bool) $directoriesAll[$i]->getVar('dir_filterrelease'); |
|
113 | 113 | $repos = []; |
114 | 114 | if (Constants::DIRECTORY_TYPE_ORG == $directoriesAll[$i]->getVar('dir_type')) { |
115 | 115 | //$github->readOrgRepositories($dirName, 100, 1); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $crRepositories->add(new \Criteria('repo_user', $dirName)); |
122 | 122 | $repositoriesCountTotal = $repositoriesHandler->getCount($crRepositories); |
123 | 123 | if ('any' === $filterRelease && $dirFilterRelease) { |
124 | - $crRepositories->add(new \Criteria('repo_prerelease', 1) ); |
|
124 | + $crRepositories->add(new \Criteria('repo_prerelease', 1)); |
|
125 | 125 | $crRepositories->add(new \Criteria('repo_release', 1), 'OR'); |
126 | 126 | } |
127 | 127 | if ('final' === $filterRelease && $dirFilterRelease) { |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | } |
179 | 179 | $directories[$i]['repos'] = $repos; |
180 | 180 | $directories[$i]['previousRepos'] = $start > 0; |
181 | - $directories[$i]['previousOp'] = '&start=' . ($start - $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
181 | + $directories[$i]['previousOp'] = '&start='.($start - $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
182 | 182 | $directories[$i]['nextRepos'] = ($repositoriesCount - $start) > $limit; |
183 | - $directories[$i]['nextOp'] = '&start=' . ($start + $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
183 | + $directories[$i]['nextOp'] = '&start='.($start + $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
184 | 184 | $GLOBALS['xoopsTpl']->assign('start', $start); |
185 | 185 | $GLOBALS['xoopsTpl']->assign('limit', $limit); |
186 | 186 | $GLOBALS['xoopsTpl']->assign('menu', $menu); |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | unset($crDirectories, $directories); |
192 | 192 | // Display Navigation |
193 | 193 | if ($directoriesCount > $limit) { |
194 | - include_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
195 | - $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
194 | + include_once \XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
195 | + $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
196 | 196 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
197 | 197 | } |
198 | 198 | $GLOBALS['xoopsTpl']->assign('lang_thereare', \sprintf(\_MA_WGGITHUB_INDEX_THEREARE, $directoriesCount)); |
@@ -210,14 +210,14 @@ discard block |
||
210 | 210 | // Breadcrumbs |
211 | 211 | $xoBreadcrumbs[] = ['title' => \_MA_WGGITHUB_INDEX]; |
212 | 212 | // Keywords |
213 | -wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords)); |
|
213 | +wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords)); |
|
214 | 214 | unset($keywords); |
215 | 215 | // Description |
216 | 216 | wggithubMetaDescription(\_MA_WGGITHUB_INDEX_DESC); |
217 | 217 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/index.php'); |
218 | 218 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL); |
219 | 219 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
220 | -require __DIR__ . '/footer.php'; |
|
220 | +require __DIR__.'/footer.php'; |
|
221 | 221 | |
222 | 222 | |
223 | 223 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * |
227 | 227 | * @return bool |
228 | 228 | */ |
229 | -function executeUpdate(){ |
|
229 | +function executeUpdate() { |
|
230 | 230 | |
231 | 231 | $github = Github::getInstance(); |
232 | 232 | $helper = Helper::getInstance(); |
@@ -30,4 +30,4 @@ |
||
30 | 30 | $GLOBALS['xoopsTpl']->assign('admin', WGGITHUB_ADMIN); |
31 | 31 | $GLOBALS['xoopsTpl']->assign('copyright', $copyright); |
32 | 32 | // |
33 | -include_once \XOOPS_ROOT_PATH . '/footer.php'; |
|
33 | +include_once \XOOPS_ROOT_PATH.'/footer.php'; |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | use XoopsModules\Wggithub\Constants; |
26 | 26 | use XoopsModules\Wggithub\Common; |
27 | 27 | |
28 | -require __DIR__ . '/header.php'; |
|
28 | +require __DIR__.'/header.php'; |
|
29 | 29 | $GLOBALS['xoopsOption']['template_main'] = 'wggithub_repositories.tpl'; |
30 | -include_once XOOPS_ROOT_PATH . '/header.php'; |
|
30 | +include_once XOOPS_ROOT_PATH.'/header.php'; |
|
31 | 31 | |
32 | 32 | $op = Request::getCmd('op', 'list'); |
33 | 33 | $start = Request::getInt('start', 0); |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | unset($repositories); |
71 | 71 | // Display Navigation |
72 | 72 | if ($repositoriesCount > $limit) { |
73 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
74 | - $pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
73 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
74 | + $pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
75 | 75 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
76 | 76 | } |
77 | 77 | $GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type')); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $xoBreadcrumbs[] = ['title' => _MA_WGGITHUB_REPOSITORIES]; |
86 | 86 | |
87 | 87 | // Keywords |
88 | -wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords)); |
|
88 | +wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords)); |
|
89 | 89 | unset($keywords); |
90 | 90 | |
91 | 91 | // Description |
@@ -93,4 +93,4 @@ discard block |
||
93 | 93 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/repositories.php'); |
94 | 94 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
95 | 95 | |
96 | -require __DIR__ . '/footer.php'; |
|
96 | +require __DIR__.'/footer.php'; |