@@ -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,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'; |
@@ -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; |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | // $query = $GLOBALS['xoopsDB']->query($sql); |
37 | 37 | // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
38 | 38 | $html .= '<fieldset>'; |
39 | - $html .= "<legend style='font-weight: bold; color: #900;'>" . \constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . '</legend>'; |
|
39 | + $html .= "<legend style='font-weight: bold; color: #900;'>".\constant('CO_'.$moduleDirNameUpper.'_IMAGEINFO').'</legend>'; |
|
40 | 40 | $html .= "<div style='padding: 8px;'>"; |
41 | 41 | // $html .= '<div>' . \constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>"; |
42 | 42 | // $html .= "<br>"; |
43 | 43 | // $html .= "<br>"; |
44 | - $html .= '<div>' . \constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . '</div>'; |
|
44 | + $html .= '<div>'.\constant('CO_'.$moduleDirNameUpper.'_SPHPINI').'</div>'; |
|
45 | 45 | $html .= '<ul>'; |
46 | 46 | |
47 | - $gdlib = \function_exists('gd_info') ? '<span style="color: #008000;">' . \constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: #ff0000;">' . \constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
48 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
47 | + $gdlib = \function_exists('gd_info') ? '<span style="color: #008000;">'.\constant('CO_'.$moduleDirNameUpper.'_GDON').'</span>' : '<span style="color: #ff0000;">'.\constant('CO_'.$moduleDirNameUpper.'_GDOFF').'</span>'; |
|
48 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS').$gdlib; |
|
49 | 49 | if (\function_exists('gd_info')) { |
50 | 50 | if (true === ($gdlib = gd_info())) { |
51 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
51 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_GDLIBVERSION').'<b>'.$gdlib['GD Version'].'</b>'; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
@@ -58,18 +58,18 @@ discard block |
||
58 | 58 | // $registerglobals = (!\ini_get('register_globals')) ? "<span style=\"color: #008000;\">" . \constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: #ff0000;\">" . \constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
59 | 59 | // $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
60 | 60 | |
61 | - $downloads = \ini_get('file_uploads') ? '<span style="color: #008000;">' . \constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: #ff0000;">' . \constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
62 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
61 | + $downloads = \ini_get('file_uploads') ? '<span style="color: #008000;">'.\constant('CO_'.$moduleDirNameUpper.'_ON').'</span>' : '<span style="color: #ff0000;">'.\constant('CO_'.$moduleDirNameUpper.'_OFF').'</span>'; |
|
62 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS').$downloads; |
|
63 | 63 | |
64 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: #0000ff;">' . \ini_get('upload_max_filesize') . '</span></b>'; |
|
65 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: #0000ff;">' . \ini_get('post_max_size') . '</span></b>'; |
|
66 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: #0000ff;">' . \ini_get('memory_limit') . '</span></b>'; |
|
64 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE').' <b><span style="color: #0000ff;">'.\ini_get('upload_max_filesize').'</span></b>'; |
|
65 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE').' <b><span style="color: #0000ff;">'.\ini_get('post_max_size').'</span></b>'; |
|
66 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT').' <b><span style="color: #0000ff;">'.\ini_get('memory_limit').'</span></b>'; |
|
67 | 67 | $html .= '</ul>'; |
68 | 68 | $html .= '<ul>'; |
69 | - $html .= '<li>' . \constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . '</b>'; |
|
69 | + $html .= '<li>'.\constant('CO_'.$moduleDirNameUpper.'_SERVERPATH').' <b>'.XOOPS_ROOT_PATH.'</b>'; |
|
70 | 70 | $html .= '</ul>'; |
71 | 71 | $html .= '<br>'; |
72 | - $html .= \constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . ''; |
|
72 | + $html .= \constant('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC').''; |
|
73 | 73 | $html .= '</div>'; |
74 | 74 | $html .= '</fieldset><br>'; |
75 | 75 |
@@ -73,7 +73,7 @@ |
||
73 | 73 | require $GLOBALS['xoops']->path('class/template.php'); |
74 | 74 | $breadcrumbTpl = new \XoopsTpl(); |
75 | 75 | $breadcrumbTpl->assign('breadcrumb', $this->bread); |
76 | - $html = $breadcrumbTpl->fetch('db:' . $this->dirname . '_common_breadcrumb.tpl'); |
|
76 | + $html = $breadcrumbTpl->fetch('db:'.$this->dirname.'_common_breadcrumb.tpl'); |
|
77 | 77 | unset($breadcrumbTpl); |
78 | 78 | |
79 | 79 | return $html; |
@@ -146,14 +146,14 @@ discard block |
||
146 | 146 | $max_height_resize = $this->maxHeight; |
147 | 147 | if ($original_w > $original_h) { |
148 | 148 | $max_height_ratio = $this->maxHeight / $original_h; |
149 | - $max_width_resize = (int)\round($original_w * $max_height_ratio); |
|
149 | + $max_width_resize = (int) \round($original_w * $max_height_ratio); |
|
150 | 150 | } else { |
151 | 151 | $max_width_ratio = $this->maxWidth / $original_w; |
152 | - $max_height_resize = (int)\round($original_h * $max_width_ratio); |
|
152 | + $max_height_resize = (int) \round($original_h * $max_width_ratio); |
|
153 | 153 | } |
154 | 154 | if ($max_width_resize < $this->maxWidth) { |
155 | 155 | $max_height_ratio = $this->maxWidth / $max_width_resize; |
156 | - $max_height_resize = (int)\round($this->maxHeight * $max_height_ratio); |
|
156 | + $max_height_resize = (int) \round($this->maxHeight * $max_height_ratio); |
|
157 | 157 | $max_width_resize = $this->maxWidth; |
158 | 158 | } |
159 | 159 | |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | $max_width_offset = 0; |
169 | 169 | $max_height_offset = 0; |
170 | 170 | if ($this->maxWidth < $max_width_resize) { |
171 | - $max_width_offset = (int)\round(($max_width_resize - $this->maxWidth) / 2); |
|
171 | + $max_width_offset = (int) \round(($max_width_resize - $this->maxWidth) / 2); |
|
172 | 172 | } else { |
173 | - $max_height_offset = (int)\round(($max_height_resize - $this->maxHeight) / 2); |
|
173 | + $max_height_offset = (int) \round(($max_height_resize - $this->maxHeight) / 2); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | if (!imagecopy($final, $thumb, 0, 0, $max_width_offset, $max_height_offset, $max_width_resize, $max_height_resize)) { |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | $dest = \imagecreatefromjpeg($this->endFile); |
190 | 190 | $src = \imagecreatefromjpeg($this->sourceFile); |
191 | 191 | if (4 == $this->mergeType) { |
192 | - $imgWidth = (int)\round($this->maxWidth / 2 - 1); |
|
193 | - $imgHeight = (int)\round($this->maxHeight / 2 - 1); |
|
194 | - $posCol2 = (int)\round($this->maxWidth / 2 + 1); |
|
195 | - $posRow2 = (int)\round($this->maxHeight / 2 + 1); |
|
192 | + $imgWidth = (int) \round($this->maxWidth / 2 - 1); |
|
193 | + $imgHeight = (int) \round($this->maxHeight / 2 - 1); |
|
194 | + $posCol2 = (int) \round($this->maxWidth / 2 + 1); |
|
195 | + $posRow2 = (int) \round($this->maxHeight / 2 + 1); |
|
196 | 196 | switch ($this->mergePos) { |
197 | 197 | case 1: |
198 | 198 | imagecopy($dest, $src, 0, 0, 0, 0, $imgWidth, $imgHeight); //top left |
@@ -209,11 +209,11 @@ discard block |
||
209 | 209 | } |
210 | 210 | } |
211 | 211 | if (6 == $this->mergeType) { |
212 | - $imgWidth = (int)\round($this->maxWidth / 3 - 1); |
|
213 | - $imgHeight = (int)\round($this->maxHeight / 2 - 1); |
|
214 | - $posCol2 = (int)\round($this->maxWidth / 3 + 1); |
|
215 | - $posCol3 = $posCol2 + (int)\round($this->maxWidth / 3 + 1); |
|
216 | - $posRow2 = (int)\round($this->maxHeight / 2 + 1); |
|
212 | + $imgWidth = (int) \round($this->maxWidth / 3 - 1); |
|
213 | + $imgHeight = (int) \round($this->maxHeight / 2 - 1); |
|
214 | + $posCol2 = (int) \round($this->maxWidth / 3 + 1); |
|
215 | + $posCol3 = $posCol2 + (int) \round($this->maxWidth / 3 + 1); |
|
216 | + $posRow2 = (int) \round($this->maxHeight / 2 + 1); |
|
217 | 217 | |
218 | 218 | switch ($this->mergePos) { |
219 | 219 | case 1: |