@@ -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); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $urlPath = $this->expandUriTemplate($urlPath, $parameters, $this->defaultParameters); |
255 | 255 | } |
256 | 256 | |
257 | - $url = rtrim($baseUrl, '/') . '/' . ltrim($urlPath, '/'); |
|
257 | + $url = rtrim($baseUrl, '/').'/'.ltrim($urlPath, '/'); |
|
258 | 258 | |
259 | 259 | if ($content !== NULL && (is_array($content) || is_object($content))) { |
260 | 260 | $headers['Content-Type'] = 'application/json; charset=utf-8'; |
@@ -394,13 +394,13 @@ discard block |
||
394 | 394 | } |
395 | 395 | $parameter = $parameters[$m[2]]; |
396 | 396 | unset($parameters[$m[2]]); |
397 | - return $m[1] . rawurlencode($parameter); |
|
397 | + return $m[1].rawurlencode($parameter); |
|
398 | 398 | }, $url); |
399 | 399 | |
400 | 400 | $url = rtrim($url, '/'); |
401 | 401 | |
402 | 402 | if (count($parameters)) { |
403 | - $url .= '?' . http_build_query($parameters); |
|
403 | + $url .= '?'.http_build_query($parameters); |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | return $url; |
@@ -421,14 +421,14 @@ discard block |
||
421 | 421 | $parameters += $defaultParameters; |
422 | 422 | |
423 | 423 | static $operatorFlags = [ |
424 | - '' => ['prefix' => '', 'separator' => ',', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => FALSE], |
|
425 | - '+' => ['prefix' => '', 'separator' => ',', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => TRUE], |
|
426 | - '#' => ['prefix' => '#', 'separator' => ',', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => TRUE], |
|
427 | - '.' => ['prefix' => '.', 'separator' => '.', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => FALSE], |
|
428 | - '/' => ['prefix' => '/', 'separator' => '/', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => FALSE], |
|
429 | - ';' => ['prefix' => ';', 'separator' => ';', 'named' => TRUE, 'ifEmpty' => '', 'reserved' => FALSE], |
|
430 | - '?' => ['prefix' => '?', 'separator' => '&', 'named' => TRUE, 'ifEmpty' => '=', 'reserved' => FALSE], |
|
431 | - '&' => ['prefix' => '&', 'separator' => '&', 'named' => TRUE, 'ifEmpty' => '=', 'reserved' => FALSE], |
|
424 | + '' => ['prefix' => '', 'separator' => ',', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => FALSE], |
|
425 | + '+' => ['prefix' => '', 'separator' => ',', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => TRUE], |
|
426 | + '#' => ['prefix' => '#', 'separator' => ',', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => TRUE], |
|
427 | + '.' => ['prefix' => '.', 'separator' => '.', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => FALSE], |
|
428 | + '/' => ['prefix' => '/', 'separator' => '/', 'named' => FALSE, 'ifEmpty' => '', 'reserved' => FALSE], |
|
429 | + ';' => ['prefix' => ';', 'separator' => ';', 'named' => TRUE, 'ifEmpty' => '', 'reserved' => FALSE], |
|
430 | + '?' => ['prefix' => '?', 'separator' => '&', 'named' => TRUE, 'ifEmpty' => '=', 'reserved' => FALSE], |
|
431 | + '&' => ['prefix' => '&', 'separator' => '&', 'named' => TRUE, 'ifEmpty' => '=', 'reserved' => FALSE], |
|
432 | 432 | ]; |
433 | 433 | |
434 | 434 | return preg_replace_callback('~{([+#./;?&])?([^}]+?)}~', function($m) use ($url, & $parameters, $operatorFlags) { |
@@ -463,17 +463,17 @@ discard block |
||
463 | 463 | if ($explode) { |
464 | 464 | $parts = []; |
465 | 465 | if ($isAssoc) { |
466 | - $this->walk($value, function ($v, $k) use (& $parts, $flags, $maxLength) { |
|
466 | + $this->walk($value, function($v, $k) use (& $parts, $flags, $maxLength) { |
|
467 | 467 | $parts[] = $this->prefix(['named' => TRUE] + $flags, $k, $this->escape($flags, $v, $maxLength)); |
468 | 468 | }); |
469 | 469 | |
470 | 470 | } elseif ($flags['named']) { |
471 | - $this->walk($value, function ($v) use (& $parts, $flags, $name, $maxLength) { |
|
471 | + $this->walk($value, function($v) use (& $parts, $flags, $name, $maxLength) { |
|
472 | 472 | $parts[] = $this->prefix($flags, $name, $this->escape($flags, $v, $maxLength)); |
473 | 473 | }); |
474 | 474 | |
475 | 475 | } else { |
476 | - $this->walk($value, function ($v) use (& $parts, $flags, $maxLength) { |
|
476 | + $this->walk($value, function($v) use (& $parts, $flags, $maxLength) { |
|
477 | 477 | $parts[] = $this->escape($flags, $v, $maxLength); |
478 | 478 | }); |
479 | 479 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | } |
505 | 505 | |
506 | 506 | if (isset($translated[0])) { |
507 | - return $flags['prefix'] . implode($flags['separator'], $translated); |
|
507 | + return $flags['prefix'].implode($flags['separator'], $translated); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | return ''; |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | } |
531 | 531 | } |
532 | 532 | |
533 | - return $prefix . $value; |
|
533 | + return $prefix.$value; |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | $value = (string) $value; |
546 | 546 | |
547 | 547 | if ($maxLength !== NULL) { |
548 | - if (preg_match('~^(.{' . $maxLength . '}).~u', $value, $m)) { |
|
548 | + if (preg_match('~^(.{'.$maxLength.'}).~u', $value, $m)) { |
|
549 | 549 | $value = $m[1]; |
550 | 550 | } elseif (strlen($value) > $maxLength) { # when malformed UTF-8 |
551 | 551 | $value = substr($value, 0, $maxLength); |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | |
559 | 559 | $escaped = ''; |
560 | 560 | for ($i = 0, $count = count($parts); $i < $count; $i += 2) { |
561 | - $escaped .= rawurlencode($parts[$i]) . $parts[$i + 1]; |
|
561 | + $escaped .= rawurlencode($parts[$i]).$parts[$i + 1]; |
|
562 | 562 | } |
563 | 563 | |
564 | 564 | return $escaped; |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | |
597 | 597 | if (isset($content->errors)) { |
598 | 598 | $message .= implode(', ', array_map(function($error) { |
599 | - return '[' . implode(':', (array) $error) . ']'; |
|
599 | + return '['.implode(':', (array) $error).']'; |
|
600 | 600 | }, $content->errors)); |
601 | 601 | } |
602 | 602 |
@@ -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 | } |
@@ -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(); |
@@ -127,7 +127,7 @@ |
||
127 | 127 | $ret['options'] = \strip_tags($this->getVar('set_options', 'e')); |
128 | 128 | $editorMaxchar = $helper->getConfig('editor_maxchar'); |
129 | 129 | $ret['options_short'] = $utility::truncateHtml($ret['options'], $editorMaxchar); |
130 | - $ret['primary'] = (int)$this->getVar('set_primary') > 0 ? _YES : _NO; |
|
130 | + $ret['primary'] = (int) $this->getVar('set_primary') > 0 ? _YES : _NO; |
|
131 | 131 | $ret['date'] = \formatTimestamp($this->getVar('set_date'), 's'); |
132 | 132 | $ret['submitter'] = \XoopsUser::getUnameFromId($this->getVar('set_submitter')); |
133 | 133 | return $ret; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | use XoopsModules\Wggithub\Helper; |
25 | 25 | use XoopsModules\Wggithub\Constants; |
26 | 26 | |
27 | -include_once XOOPS_ROOT_PATH . '/modules/wggithub/include/common.php'; |
|
27 | +include_once XOOPS_ROOT_PATH.'/modules/wggithub/include/common.php'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Function show block |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | function b_wggithub_repositories_show($options) |
35 | 35 | { |
36 | - include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php'; |
|
36 | + include_once XOOPS_ROOT_PATH.'/modules/wggithub/class/repositories.php'; |
|
37 | 37 | $myts = MyTextSanitizer::getInstance(); |
38 | 38 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
39 | 39 | $block = []; |
@@ -98,14 +98,14 @@ discard block |
||
98 | 98 | */ |
99 | 99 | function b_wggithub_repositories_edit($options) |
100 | 100 | { |
101 | - include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php'; |
|
101 | + include_once XOOPS_ROOT_PATH.'/modules/wggithub/class/repositories.php'; |
|
102 | 102 | $helper = Helper::getInstance(); |
103 | 103 | $repositoriesHandler = $helper->getHandler('Repositories'); |
104 | 104 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
105 | 105 | $form = _MB_WGGITHUB_DISPLAY; |
106 | 106 | $form .= "<input type='hidden' name='options[0]' value='".$options[0]."' />"; |
107 | - $form .= "<input type='text' name='options[1]' size='5' maxlength='255' value='" . $options[1] . "' /> <br>"; |
|
108 | - $form .= _MB_WGGITHUB_TITLE_LENGTH . " : <input type='text' name='options[2]' size='5' maxlength='255' value='" . $options[2] . "' /><br><br>"; |
|
107 | + $form .= "<input type='text' name='options[1]' size='5' maxlength='255' value='".$options[1]."' /> <br>"; |
|
108 | + $form .= _MB_WGGITHUB_TITLE_LENGTH." : <input type='text' name='options[2]' size='5' maxlength='255' value='".$options[2]."' /><br><br>"; |
|
109 | 109 | \array_shift($options); |
110 | 110 | \array_shift($options); |
111 | 111 | \array_shift($options); |
@@ -116,11 +116,11 @@ discard block |
||
116 | 116 | $crRepositories->setOrder('ASC'); |
117 | 117 | $repositoriesAll = $repositoriesHandler->getAll($crRepositories); |
118 | 118 | unset($crRepositories); |
119 | - $form .= _MB_WGGITHUB_REPOSITORIES_TO_DISPLAY . "<br><select name='options[]' multiple='multiple' size='5'>"; |
|
120 | - $form .= "<option value='0' " . (\in_array(0, $options) == false ? '' : "selected='selected'") . '>' . _MB_WGGITHUB_ALL_REPOSITORIES . '</option>'; |
|
119 | + $form .= _MB_WGGITHUB_REPOSITORIES_TO_DISPLAY."<br><select name='options[]' multiple='multiple' size='5'>"; |
|
120 | + $form .= "<option value='0' ".(\in_array(0, $options) == false ? '' : "selected='selected'").'>'._MB_WGGITHUB_ALL_REPOSITORIES.'</option>'; |
|
121 | 121 | foreach (\array_keys($repositoriesAll) as $i) { |
122 | 122 | $repo_id = $repositoriesAll[$i]->getVar('repo_id'); |
123 | - $form .= "<option value='" . $repo_id . "' " . (\in_array($repo_id, $options) == false ? '' : "selected='selected'") . '>' . $repositoriesAll[$i]->getVar('repo_name') . '</option>'; |
|
123 | + $form .= "<option value='".$repo_id."' ".(\in_array($repo_id, $options) == false ? '' : "selected='selected'").'>'.$repositoriesAll[$i]->getVar('repo_name').'</option>'; |
|
124 | 124 | } |
125 | 125 | $form .= '</select>'; |
126 | 126 |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | 'license_url' => 'http://www.gnu.org/licenses/gpl-3.0.en.html', |
38 | 38 | 'help' => 'page=help', |
39 | 39 | 'release_info' => 'release_info', |
40 | - 'release_file' => XOOPS_URL . '/modules/wggithub/docs/release_info file', |
|
40 | + 'release_file' => XOOPS_URL.'/modules/wggithub/docs/release_info file', |
|
41 | 41 | 'release_date' => '2020/11/21', |
42 | 42 | 'manual' => 'link to manual file', |
43 | - 'manual_file' => XOOPS_URL . '/modules/wggithub/docs/install.txt', |
|
43 | + 'manual_file' => XOOPS_URL.'/modules/wggithub/docs/install.txt', |
|
44 | 44 | 'min_php' => '7.2', |
45 | 45 | 'min_xoops' => '2.5.10', |
46 | 46 | 'min_admin' => '1.2', |
@@ -289,8 +289,8 @@ discard block |
||
289 | 289 | // Make Sample button visible? |
290 | 290 | $modversion['config'][] = [ |
291 | 291 | 'name' => 'displaySampleButton', |
292 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', |
|
293 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', |
|
292 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', |
|
293 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', |
|
294 | 294 | 'formtype' => 'yesno', |
295 | 295 | 'valuetype' => 'int', |
296 | 296 | 'default' => 1, |
@@ -20,8 +20,8 @@ |
||
20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
21 | 21 | */ |
22 | 22 | |
23 | -include_once __DIR__ . '/common.php'; |
|
24 | -include_once __DIR__ . '/main.php'; |
|
23 | +include_once __DIR__.'/common.php'; |
|
24 | +include_once __DIR__.'/main.php'; |
|
25 | 25 | |
26 | 26 | // ---------------- Admin Index ---------------- |
27 | 27 | \define('_AM_WGGITHUB_STATISTICS', 'Statistiken'); |