@@ -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 | } |
@@ -70,7 +70,7 @@ |
||
70 | 70 | */ |
71 | 71 | public function getHandler($name) |
72 | 72 | { |
73 | - $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
73 | + $class = __NAMESPACE__.'\\'.\ucfirst($name).'Handler'; |
|
74 | 74 | if (!\class_exists($class)) { |
75 | 75 | throw new \RuntimeException("Class '$class' not found"); |
76 | 76 | } |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | { |
57 | 57 | if ($considerHtml) { |
58 | 58 | // if the plain text is shorter than the maximum length, return the whole text |
59 | - if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) { |
|
59 | + if (mb_strlen(\preg_replace('/<.*?'.'>/', '', $text)) <= $length) { |
|
60 | 60 | return $text; |
61 | 61 | } |
62 | 62 | // splits all html-tags to scanable lines |
63 | - \preg_match_all('/(<.+?' . '>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER); |
|
63 | + \preg_match_all('/(<.+?'.'>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER); |
|
64 | 64 | $total_length = mb_strlen($ending); |
65 | 65 | $open_tags = []; |
66 | 66 | $truncate = ''; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | unset($open_tags[$pos]); |
79 | 79 | } |
80 | 80 | // if tag is an opening tag |
81 | - } elseif (\preg_match('/^<\s*([^\s>!]+).*?' . '>$/s', $line_matchings[1], $tag_matchings)) { |
|
81 | + } elseif (\preg_match('/^<\s*([^\s>!]+).*?'.'>$/s', $line_matchings[1], $tag_matchings)) { |
|
82 | 82 | // add tag to the beginning of $open_tags list |
83 | 83 | \array_unshift($open_tags, \mb_strtolower($tag_matchings[1])); |
84 | 84 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | if ($considerHtml) { |
139 | 139 | // close all unclosed html-tags |
140 | 140 | foreach ($open_tags as $tag) { |
141 | - $truncate .= '</' . $tag . '>'; |
|
141 | + $truncate .= '</'.$tag.'>'; |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | //--></script> |
212 | 212 | <!-- End Form Validation JavaScript //-->', |
213 | 213 | ]; |
214 | - $paypalform = [ |
|
214 | + $paypalform = [ |
|
215 | 215 | 0 => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">', |
216 | 216 | 1 => '<input name="cmd" value="_s-xclick" type="hidden">', |
217 | 217 | 2 => '<input name="hosted_button_id" value="%s" type="hidden">', |
@@ -224,11 +224,11 @@ discard block |
||
224 | 224 | case 2: |
225 | 225 | $donationform[$key] = \sprintf( |
226 | 226 | $donationform[$key], |
227 | - $GLOBALS['xoopsConfig']['sitename'] . ' - ' . ('' != $GLOBALS['xoopsUser']->getVar('name') ? $GLOBALS['xoopsUser']->getVar('name') . ' [' . $GLOBALS['xoopsUser']->getVar('uname') . ']' : $GLOBALS['xoopsUser']->getVar('uname')), |
|
227 | + $GLOBALS['xoopsConfig']['sitename'].' - '.('' != $GLOBALS['xoopsUser']->getVar('name') ? $GLOBALS['xoopsUser']->getVar('name').' ['.$GLOBALS['xoopsUser']->getVar('uname').']' : $GLOBALS['xoopsUser']->getVar('uname')), |
|
228 | 228 | $GLOBALS['xoopsUser']->getVar('email'), |
229 | 229 | XOOPS_LICENSE_KEY, |
230 | 230 | \mb_strtoupper($GLOBALS['xoopsModule']->getVar('dirname')), |
231 | - \mb_strtoupper($GLOBALS['xoopsModule']->getVar('dirname')) . ' ' . $GLOBALS['xoopsModule']->getVar('name') |
|
231 | + \mb_strtoupper($GLOBALS['xoopsModule']->getVar('dirname')).' '.$GLOBALS['xoopsModule']->getVar('name') |
|
232 | 232 | ); |
233 | 233 | break; |
234 | 234 | } |
@@ -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)) { |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $readmesObj->setVar('rm_content', $readme['content']); |
171 | 171 | $readmesObj->setVar('rm_encoding', $readme['encoding']); |
172 | 172 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
173 | - $readmesObj->setVar('rm_datecreated',\time()); |
|
173 | + $readmesObj->setVar('rm_datecreated', \time()); |
|
174 | 174 | $readmesObj->setVar('rm_submitter', $submitter); |
175 | 175 | // Insert Data |
176 | 176 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
233 | 233 | $baseurl = \substr($readme['html_url'], 0, \strrpos($readme['html_url'], '/') + 1); |
234 | 234 | $readmesObj->setVar('rm_baseurl', $baseurl); |
235 | - $readmesObj->setVar('rm_datecreated',\time()); |
|
235 | + $readmesObj->setVar('rm_datecreated', \time()); |
|
236 | 236 | $readmesObj->setVar('rm_submitter', $submitter); |
237 | 237 | // Insert Data |
238 | 238 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -266,10 +266,10 @@ discard block |
||
266 | 266 | public function updateRepoReadme() |
267 | 267 | { |
268 | 268 | // update repo_readme |
269 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . ' INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
|
270 | - $sql .= ' ON ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_id = ' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes') . '.rm_repoid '; |
|
271 | - $sql .= 'SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_readme = 1 '; |
|
272 | - $sql .= 'WHERE (((' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes') . '.rm_id)>0));'; |
|
269 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').' INNER JOIN '.$GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
|
270 | + $sql .= ' ON '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_id = '.$GLOBALS['xoopsDB']->prefix('wggithub_readmes').'.rm_repoid '; |
|
271 | + $sql .= 'SET '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_readme = 1 '; |
|
272 | + $sql .= 'WHERE ((('.$GLOBALS['xoopsDB']->prefix('wggithub_readmes').'.rm_id)>0));'; |
|
273 | 273 | $GLOBALS['xoopsDB']->queryF($sql); |
274 | 274 | |
275 | 275 | return true; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | if (isset($CurrentBlock['continuable'])) |
211 | 211 | { |
212 | - $methodName = 'block' . $CurrentBlock['type'] . 'Continue'; |
|
212 | + $methodName = 'block'.$CurrentBlock['type'].'Continue'; |
|
213 | 213 | $Block = $this->$methodName($Line, $CurrentBlock); |
214 | 214 | |
215 | 215 | if (isset($Block)) |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | } else { |
221 | 221 | if ($this->isBlockCompletable($CurrentBlock['type'])) |
222 | 222 | { |
223 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
223 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
224 | 224 | $CurrentBlock = $this->$methodName($CurrentBlock); |
225 | 225 | } |
226 | 226 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | { |
239 | 239 | foreach ($this->BlockTypes[$marker] as $blockType) |
240 | 240 | { |
241 | - $blockTypes []= $blockType; |
|
241 | + $blockTypes [] = $blockType; |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | { |
254 | 254 | $Block['type'] = $blockType; |
255 | 255 | |
256 | - if ( ! isset($Block['identified'])) |
|
256 | + if (!isset($Block['identified'])) |
|
257 | 257 | { |
258 | 258 | if (isset($CurrentBlock)) |
259 | 259 | { |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | |
301 | 301 | if (isset($CurrentBlock['continuable']) and $this->isBlockCompletable($CurrentBlock['type'])) |
302 | 302 | { |
303 | - $methodName = 'block' . $CurrentBlock['type'] . 'Complete'; |
|
303 | + $methodName = 'block'.$CurrentBlock['type'].'Complete'; |
|
304 | 304 | $CurrentBlock = $this->$methodName($CurrentBlock); |
305 | 305 | } |
306 | 306 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | |
319 | 319 | protected function extractElement(array $Component) |
320 | 320 | { |
321 | - if ( ! isset($Component['element'])) |
|
321 | + if (!isset($Component['element'])) |
|
322 | 322 | { |
323 | 323 | if (isset($Component['markup'])) |
324 | 324 | { |
@@ -333,12 +333,12 @@ discard block |
||
333 | 333 | |
334 | 334 | protected function isBlockContinuable($Type) |
335 | 335 | { |
336 | - return method_exists($this, 'block' . $Type . 'Continue'); |
|
336 | + return method_exists($this, 'block'.$Type.'Continue'); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | protected function isBlockCompletable($Type) |
340 | 340 | { |
341 | - return method_exists($this, 'block' . $Type . 'Complete'); |
|
341 | + return method_exists($this, 'block'.$Type.'Complete'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | # |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | |
347 | 347 | protected function blockCode($Line, $Block = null) |
348 | 348 | { |
349 | - if (isset($Block) and $Block['type'] === 'Paragraph' and ! isset($Block['interrupted'])) |
|
349 | + if (isset($Block) and $Block['type'] === 'Paragraph' and !isset($Block['interrupted'])) |
|
350 | 350 | { |
351 | 351 | return; |
352 | 352 | } |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | return; |
431 | 431 | } |
432 | 432 | |
433 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
433 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
434 | 434 | |
435 | 435 | if (\strpos($Line['text'], '-->') !== false) |
436 | 436 | { |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | return $Block; |
522 | 522 | } |
523 | 523 | |
524 | - $Block['element']['element']['text'] .= "\n" . $Line['body']; |
|
524 | + $Block['element']['element']['text'] .= "\n".$Line['body']; |
|
525 | 525 | |
526 | 526 | return $Block; |
527 | 527 | } |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | |
555 | 555 | $Block = array( |
556 | 556 | 'element' => array( |
557 | - 'name' => 'h' . $level, |
|
557 | + 'name' => 'h'.$level, |
|
558 | 558 | 'handler' => array( |
559 | 559 | 'function' => 'lineElements', |
560 | 560 | 'argument' => $text, |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | { |
582 | 582 | $contentIndent -= 1; |
583 | 583 | $matches[1] = \substr($matches[1], 0, -$contentIndent); |
584 | - $matches[3] = str_repeat(' ', $contentIndent) . $matches[3]; |
|
584 | + $matches[3] = str_repeat(' ', $contentIndent).$matches[3]; |
|
585 | 585 | } elseif ($contentIndent === 0) { |
586 | 586 | $matches[1] .= ' '; |
587 | 587 | } |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | if ( |
613 | 613 | isset($CurrentBlock) |
614 | 614 | and $CurrentBlock['type'] === 'Paragraph' |
615 | - and ! isset($CurrentBlock['interrupted']) |
|
615 | + and !isset($CurrentBlock['interrupted']) |
|
616 | 616 | ) { |
617 | 617 | return; |
618 | 618 | } |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | ) |
631 | 631 | ); |
632 | 632 | |
633 | - $Block['element']['elements'] []= & $Block['li']; |
|
633 | + $Block['element']['elements'] [] = & $Block['li']; |
|
634 | 634 | |
635 | 635 | return $Block; |
636 | 636 | } |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | ) |
658 | 658 | ) { |
659 | 659 | if (isset($Block['interrupted'])) { |
660 | - $Block['li']['handler']['argument'] []= ''; |
|
660 | + $Block['li']['handler']['argument'] [] = ''; |
|
661 | 661 | |
662 | 662 | $Block['loose'] = true; |
663 | 663 | |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | ) |
680 | 680 | ); |
681 | 681 | |
682 | - $Block['element']['elements'] []= & $Block['li']; |
|
682 | + $Block['element']['elements'] [] = & $Block['li']; |
|
683 | 683 | |
684 | 684 | return $Block; |
685 | 685 | } elseif ($Line['indent'] < $requiredIndent and $this->blockList($Line)) { |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | if ($Line['indent'] >= $requiredIndent) { |
694 | 694 | if (isset($Block['interrupted'])) |
695 | 695 | { |
696 | - $Block['li']['handler']['argument'] []= ''; |
|
696 | + $Block['li']['handler']['argument'] [] = ''; |
|
697 | 697 | |
698 | 698 | $Block['loose'] = true; |
699 | 699 | |
@@ -702,15 +702,15 @@ discard block |
||
702 | 702 | |
703 | 703 | $text = \substr($Line['body'], $requiredIndent); |
704 | 704 | |
705 | - $Block['li']['handler']['argument'] []= $text; |
|
705 | + $Block['li']['handler']['argument'] [] = $text; |
|
706 | 706 | |
707 | 707 | return $Block; |
708 | 708 | } |
709 | 709 | |
710 | - if ( ! isset($Block['interrupted'])) { |
|
710 | + if (!isset($Block['interrupted'])) { |
|
711 | 711 | $text = \preg_replace('/^[ ]{0,'.$requiredIndent.'}+/', '', $Line['body']); |
712 | 712 | |
713 | - $Block['li']['handler']['argument'] []= $text; |
|
713 | + $Block['li']['handler']['argument'] [] = $text; |
|
714 | 714 | |
715 | 715 | return $Block; |
716 | 716 | } |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | { |
724 | 724 | if (end($li['handler']['argument']) !== '') |
725 | 725 | { |
726 | - $li['handler']['argument'] []= ''; |
|
726 | + $li['handler']['argument'] [] = ''; |
|
727 | 727 | } |
728 | 728 | } |
729 | 729 | } |
@@ -759,13 +759,13 @@ discard block |
||
759 | 759 | } |
760 | 760 | |
761 | 761 | if ($Line['text'][0] === '>' and \preg_match('/^>[ ]?+(.*+)/', $Line['text'], $matches)) { |
762 | - $Block['element']['handler']['argument'] []= $matches[1]; |
|
762 | + $Block['element']['handler']['argument'] [] = $matches[1]; |
|
763 | 763 | |
764 | 764 | return $Block; |
765 | 765 | } |
766 | 766 | |
767 | - if ( ! isset($Block['interrupted'])) { |
|
768 | - $Block['element']['handler']['argument'] []= $Line['text']; |
|
767 | + if (!isset($Block['interrupted'])) { |
|
768 | + $Block['element']['handler']['argument'] [] = $Line['text']; |
|
769 | 769 | |
770 | 770 | return $Block; |
771 | 771 | } |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | |
795 | 795 | protected function blockSetextHeader($Line, array $Block = null) |
796 | 796 | { |
797 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { |
|
797 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { |
|
798 | 798 | return; |
799 | 799 | } |
800 | 800 | |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | return; |
840 | 840 | } |
841 | 841 | |
842 | - $Block['element']['rawHtml'] .= "\n" . $Line['body']; |
|
842 | + $Block['element']['rawHtml'] .= "\n".$Line['body']; |
|
843 | 843 | |
844 | 844 | return $Block; |
845 | 845 | } |
@@ -874,7 +874,7 @@ discard block |
||
874 | 874 | |
875 | 875 | protected function blockTable($Line, array $Block = null) |
876 | 876 | { |
877 | - if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { |
|
877 | + if (!isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { |
|
878 | 878 | return; |
879 | 879 | } |
880 | 880 | |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | $alignment = $alignment === 'left' ? 'center' : 'right'; |
918 | 918 | } |
919 | 919 | |
920 | - $alignments []= $alignment; |
|
920 | + $alignments [] = $alignment; |
|
921 | 921 | } |
922 | 922 | |
923 | 923 | # ~ |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | ); |
956 | 956 | } |
957 | 957 | |
958 | - $HeaderElements []= $HeaderElement; |
|
958 | + $HeaderElements [] = $HeaderElement; |
|
959 | 959 | } |
960 | 960 | |
961 | 961 | # ~ |
@@ -969,16 +969,16 @@ discard block |
||
969 | 969 | ), |
970 | 970 | ); |
971 | 971 | |
972 | - $Block['element']['elements'] []= array( |
|
972 | + $Block['element']['elements'] [] = array( |
|
973 | 973 | 'name' => 'thead', |
974 | 974 | ); |
975 | 975 | |
976 | - $Block['element']['elements'] []= array( |
|
976 | + $Block['element']['elements'] [] = array( |
|
977 | 977 | 'name' => 'tbody', |
978 | 978 | 'elements' => array(), |
979 | 979 | ); |
980 | 980 | |
981 | - $Block['element']['elements'][0]['elements'] []= array( |
|
981 | + $Block['element']['elements'][0]['elements'] [] = array( |
|
982 | 982 | 'name' => 'tr', |
983 | 983 | 'elements' => $HeaderElements, |
984 | 984 | ); |
@@ -1021,11 +1021,11 @@ discard block |
||
1021 | 1021 | if (isset($Block['alignments'][$index])) |
1022 | 1022 | { |
1023 | 1023 | $Element['attributes'] = array( |
1024 | - 'style' => 'text-align: ' . $Block['alignments'][$index] . ';', |
|
1024 | + 'style' => 'text-align: '.$Block['alignments'][$index].';', |
|
1025 | 1025 | ); |
1026 | 1026 | } |
1027 | 1027 | |
1028 | - $Elements []= $Element; |
|
1028 | + $Elements [] = $Element; |
|
1029 | 1029 | } |
1030 | 1030 | |
1031 | 1031 | $Element = array( |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | 'elements' => $Elements, |
1034 | 1034 | ); |
1035 | 1035 | |
1036 | - $Block['element']['elements'][1]['elements'] []= $Element; |
|
1036 | + $Block['element']['elements'][1]['elements'] [] = $Element; |
|
1037 | 1037 | |
1038 | 1038 | return $Block; |
1039 | 1039 | } |
@@ -1133,7 +1133,7 @@ discard block |
||
1133 | 1133 | |
1134 | 1134 | $Inline = $this->{"inline$inlineType"}($Excerpt); |
1135 | 1135 | |
1136 | - if ( ! isset($Inline)) |
|
1136 | + if (!isset($Inline)) |
|
1137 | 1137 | { |
1138 | 1138 | continue; |
1139 | 1139 | } |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | |
1148 | 1148 | # sets a default inline position |
1149 | 1149 | |
1150 | - if ( ! isset($Inline['position'])) |
|
1150 | + if (!isset($Inline['position'])) |
|
1151 | 1151 | { |
1152 | 1152 | $Inline['position'] = $markerPosition; |
1153 | 1153 | } |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | |
1192 | 1192 | foreach ($Elements as &$Element) |
1193 | 1193 | { |
1194 | - if ( ! isset($Element['autobreak'])) |
|
1194 | + if (!isset($Element['autobreak'])) |
|
1195 | 1195 | { |
1196 | 1196 | $Element['autobreak'] = false; |
1197 | 1197 | } |
@@ -1247,14 +1247,14 @@ discard block |
||
1247 | 1247 | $hostnameLabel = '[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?'; |
1248 | 1248 | |
1249 | 1249 | $commonMarkEmail = '[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]++@' |
1250 | - . $hostnameLabel . '(?:\.' . $hostnameLabel . ')*'; |
|
1250 | + . $hostnameLabel.'(?:\.'.$hostnameLabel.')*'; |
|
1251 | 1251 | |
1252 | 1252 | if (\strpos($Excerpt['text'], '>') !== false |
1253 | 1253 | and \preg_match("/^<((mailto:)?$commonMarkEmail)>/i", $Excerpt['text'], $matches) |
1254 | - ){ |
|
1254 | + ) { |
|
1255 | 1255 | $url = $matches[1]; |
1256 | 1256 | |
1257 | - if ( ! isset($matches[2])) |
|
1257 | + if (!isset($matches[2])) |
|
1258 | 1258 | { |
1259 | 1259 | $url = "mailto:$url"; |
1260 | 1260 | } |
@@ -1274,7 +1274,7 @@ discard block |
||
1274 | 1274 | |
1275 | 1275 | protected function inlineEmphasis($Excerpt) |
1276 | 1276 | { |
1277 | - if ( ! isset($Excerpt['text'][1])) |
|
1277 | + if (!isset($Excerpt['text'][1])) |
|
1278 | 1278 | { |
1279 | 1279 | return; |
1280 | 1280 | } |
@@ -1320,12 +1320,12 @@ discard block |
||
1320 | 1320 | |
1321 | 1321 | protected function inlineImage($Excerpt) |
1322 | 1322 | { |
1323 | - if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
1323 | + if (!isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') |
|
1324 | 1324 | { |
1325 | 1325 | return; |
1326 | 1326 | } |
1327 | 1327 | |
1328 | - $Excerpt['text']= \substr($Excerpt['text'], 1); |
|
1328 | + $Excerpt['text'] = \substr($Excerpt['text'], 1); |
|
1329 | 1329 | |
1330 | 1330 | $Link = $this->inlineLink($Excerpt); |
1331 | 1331 | |
@@ -1411,7 +1411,7 @@ discard block |
||
1411 | 1411 | $definition = strtolower($Element['handler']['argument']); |
1412 | 1412 | } |
1413 | 1413 | |
1414 | - if ( ! isset($this->DefinitionData['Reference'][$definition])) |
|
1414 | + if (!isset($this->DefinitionData['Reference'][$definition])) |
|
1415 | 1415 | { |
1416 | 1416 | return; |
1417 | 1417 | } |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | and \preg_match('/^&(#?+[0-9a-zA-Z]++);/', $Excerpt['text'], $matches) |
1467 | 1467 | ) { |
1468 | 1468 | return array( |
1469 | - 'element' => array('rawHtml' => '&' . $matches[1] . ';'), |
|
1469 | + 'element' => array('rawHtml' => '&'.$matches[1].';'), |
|
1470 | 1470 | 'extent' => \strlen($matches[0]), |
1471 | 1471 | ); |
1472 | 1472 | } |
@@ -1476,7 +1476,7 @@ discard block |
||
1476 | 1476 | |
1477 | 1477 | protected function inlineStrikethrough($Excerpt) |
1478 | 1478 | { |
1479 | - if ( ! isset($Excerpt['text'][1])) |
|
1479 | + if (!isset($Excerpt['text'][1])) |
|
1480 | 1480 | { |
1481 | 1481 | return; |
1482 | 1482 | } |
@@ -1499,7 +1499,7 @@ discard block |
||
1499 | 1499 | |
1500 | 1500 | protected function inlineUrl($Excerpt) |
1501 | 1501 | { |
1502 | - if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
1502 | + if ($this->urlsLinked !== true or !isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') |
|
1503 | 1503 | { |
1504 | 1504 | return; |
1505 | 1505 | } |
@@ -1670,7 +1670,7 @@ discard block |
||
1670 | 1670 | |
1671 | 1671 | if ($hasName) |
1672 | 1672 | { |
1673 | - $markup .= '<' . $Element['name']; |
|
1673 | + $markup .= '<'.$Element['name']; |
|
1674 | 1674 | |
1675 | 1675 | if (isset($Element['attributes'])) |
1676 | 1676 | { |
@@ -1728,7 +1728,7 @@ discard block |
||
1728 | 1728 | } |
1729 | 1729 | } |
1730 | 1730 | |
1731 | - $markup .= $hasName ? '</' . $Element['name'] . '>' : ''; |
|
1731 | + $markup .= $hasName ? '</'.$Element['name'].'>' : ''; |
|
1732 | 1732 | } |
1733 | 1733 | elseif ($hasName) |
1734 | 1734 | { |
@@ -1757,7 +1757,7 @@ discard block |
||
1757 | 1757 | // (autobreak === false) covers both sides of an element |
1758 | 1758 | $autoBreak = !$autoBreak ? $autoBreak : $autoBreakNext; |
1759 | 1759 | |
1760 | - $markup .= ($autoBreak ? "\n" : '') . $this->element($Element); |
|
1760 | + $markup .= ($autoBreak ? "\n" : '').$this->element($Element); |
|
1761 | 1761 | $autoBreak = $autoBreakNext; |
1762 | 1762 | } |
1763 | 1763 | |
@@ -1772,7 +1772,7 @@ discard block |
||
1772 | 1772 | { |
1773 | 1773 | $Elements = $this->linesElements($lines); |
1774 | 1774 | |
1775 | - if ( ! \in_array('', $lines) |
|
1775 | + if (!\in_array('', $lines) |
|
1776 | 1776 | and isset($Elements[0]) and isset($Elements[0]['name']) |
1777 | 1777 | and $Elements[0]['name'] === 'p' |
1778 | 1778 | ) { |
@@ -1829,12 +1829,12 @@ discard block |
||
1829 | 1829 | protected function sanitiseElement(array $Element) |
1830 | 1830 | { |
1831 | 1831 | static $goodAttribute = '/^[a-zA-Z0-9][a-zA-Z0-9-_]*+$/'; |
1832 | - static $safeUrlNameToAtt = array( |
|
1832 | + static $safeUrlNameToAtt = array( |
|
1833 | 1833 | 'a' => 'href', |
1834 | 1834 | 'img' => 'src', |
1835 | 1835 | ); |
1836 | 1836 | |
1837 | - if ( ! isset($Element['name'])) |
|
1837 | + if (!isset($Element['name'])) |
|
1838 | 1838 | { |
1839 | 1839 | unset($Element['attributes']); |
1840 | 1840 | return $Element; |
@@ -1845,12 +1845,12 @@ discard block |
||
1845 | 1845 | $Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element['name']]); |
1846 | 1846 | } |
1847 | 1847 | |
1848 | - if ( ! empty($Element['attributes'])) |
|
1848 | + if (!empty($Element['attributes'])) |
|
1849 | 1849 | { |
1850 | 1850 | foreach ($Element['attributes'] as $att => $val) |
1851 | 1851 | { |
1852 | 1852 | # filter out badly parsed attribute |
1853 | - if ( ! \preg_match($goodAttribute, $att)) |
|
1853 | + if (!\preg_match($goodAttribute, $att)) |
|
1854 | 1854 | { |
1855 | 1855 | unset($Element['attributes'][$att]); |
1856 | 1856 | } |
@@ -1951,8 +1951,8 @@ discard block |
||
1951 | 1951 | protected $textLevelElements = array( |
1952 | 1952 | 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', |
1953 | 1953 | 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', |
1954 | - 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
1955 | - 'q', 'rt', 'ins', 'font', 'strong', |
|
1954 | + 'i', 'rp', 'del', 'code', 'strike', 'marquee', |
|
1955 | + 'q', 'rt', 'ins', 'font', 'strong', |
|
1956 | 1956 | 's', 'tt', 'kbd', 'mark', |
1957 | 1957 | 'u', 'xm', 'sub', 'nobr', |
1958 | 1958 | 'sup', 'ruby', |