@@ -763,7 +763,7 @@ |
||
763 | 763 | * @param bool $mq_fix Boolean whether or not to enable magic quotes fix |
764 | 764 | * @param HTMLPurifier_ConfigSchema $schema Schema to use, if not global copy |
765 | 765 | * |
766 | - * @return mixed |
|
766 | + * @return HTMLPurifier_Config |
|
767 | 767 | */ |
768 | 768 | public static function loadArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true, $schema = null) |
769 | 769 | { |
@@ -782,8 +782,8 @@ |
||
782 | 782 | */ |
783 | 783 | public function mergeArrayFromForm($array, $index = false, $allowed = true, $mq_fix = true) |
784 | 784 | { |
785 | - $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def); |
|
786 | - $this->loadArray($ret); |
|
785 | + $ret = HTMLPurifier_Config::prepareArrayFromForm($array, $index, $allowed, $mq_fix, $this->def); |
|
786 | + $this->loadArray($ret); |
|
787 | 787 | } |
788 | 788 | |
789 | 789 | /** |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if (!isset($this->def->info[$key])) { |
182 | 182 | // can't add % due to SimpleTest bug |
183 | 183 | $this->triggerError( |
184 | - 'Cannot retrieve value of undefined directive ' . htmlspecialchars($key), |
|
184 | + 'Cannot retrieve value of undefined directive '.htmlspecialchars($key), |
|
185 | 185 | E_USER_WARNING |
186 | 186 | ); |
187 | 187 | return; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | if (isset($this->def->info[$key]->isAlias)) { |
190 | 190 | $d = $this->def->info[$key]; |
191 | 191 | $this->triggerError( |
192 | - 'Cannot get value from aliased directive, use real name ' . $d->key, |
|
192 | + 'Cannot get value from aliased directive, use real name '.$d->key, |
|
193 | 193 | E_USER_ERROR |
194 | 194 | ); |
195 | 195 | return; |
@@ -198,9 +198,9 @@ discard block |
||
198 | 198 | list($ns) = explode('.', $key); |
199 | 199 | if ($ns !== $this->lock) { |
200 | 200 | $this->triggerError( |
201 | - 'Cannot get value of namespace ' . $ns . ' when lock for ' . |
|
202 | - $this->lock . |
|
203 | - ' is active, this probably indicates a Definition setup method ' . |
|
201 | + 'Cannot get value of namespace '.$ns.' when lock for '. |
|
202 | + $this->lock. |
|
203 | + ' is active, this probably indicates a Definition setup method '. |
|
204 | 204 | 'is accessing directives that are not within its namespace', |
205 | 205 | E_USER_ERROR |
206 | 206 | ); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $full = $this->getAll(); |
226 | 226 | if (!isset($full[$namespace])) { |
227 | 227 | $this->triggerError( |
228 | - 'Cannot retrieve undefined namespace ' . |
|
228 | + 'Cannot retrieve undefined namespace '. |
|
229 | 229 | htmlspecialchars($namespace), |
230 | 230 | E_USER_WARNING |
231 | 231 | ); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | } |
310 | 310 | if (!isset($this->def->info[$key])) { |
311 | 311 | $this->triggerError( |
312 | - 'Cannot set undefined directive ' . htmlspecialchars($key) . ' to value', |
|
312 | + 'Cannot set undefined directive '.htmlspecialchars($key).' to value', |
|
313 | 313 | E_USER_WARNING |
314 | 314 | ); |
315 | 315 | return; |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | if ($this->aliasMode) { |
321 | 321 | $this->triggerError( |
322 | 322 | 'Double-aliases not allowed, please fix '. |
323 | - 'ConfigSchema bug with' . $key, |
|
323 | + 'ConfigSchema bug with'.$key, |
|
324 | 324 | E_USER_ERROR |
325 | 325 | ); |
326 | 326 | return; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $value = $this->parser->parse($value, $type, $allow_null); |
348 | 348 | } catch (HTMLPurifier_VarParserException $e) { |
349 | 349 | $this->triggerError( |
350 | - 'Value for ' . $key . ' is of invalid type, should be ' . |
|
350 | + 'Value for '.$key.' is of invalid type, should be '. |
|
351 | 351 | HTMLPurifier_VarParser::getTypeName($type), |
352 | 352 | E_USER_WARNING |
353 | 353 | ); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | // check to see if the value is allowed |
362 | 362 | if (isset($def->allowed) && !isset($def->allowed[$value])) { |
363 | 363 | $this->triggerError( |
364 | - 'Value not supported, valid values are: ' . |
|
364 | + 'Value not supported, valid values are: '. |
|
365 | 365 | $this->_listify($def->allowed), |
366 | 366 | E_USER_WARNING |
367 | 367 | ); |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | // check preconditions |
525 | 525 | $def = null; |
526 | 526 | if ($optimized) { |
527 | - if (is_null($this->get($type . '.DefinitionID'))) { |
|
527 | + if (is_null($this->get($type.'.DefinitionID'))) { |
|
528 | 528 | // fatally error out if definition ID not set |
529 | 529 | throw new HTMLPurifier_Exception( |
530 | 530 | "Cannot retrieve raw version without specifying %$type.DefinitionID" |
@@ -535,17 +535,16 @@ discard block |
||
535 | 535 | $def = $this->definitions[$type]; |
536 | 536 | if ($def->setup && !$optimized) { |
537 | 537 | $extra = $this->chatty ? |
538 | - " (try moving this code block earlier in your initialization)" : |
|
539 | - ""; |
|
538 | + " (try moving this code block earlier in your initialization)" : ""; |
|
540 | 539 | throw new HTMLPurifier_Exception( |
541 | - "Cannot retrieve raw definition after it has already been setup" . |
|
540 | + "Cannot retrieve raw definition after it has already been setup". |
|
542 | 541 | $extra |
543 | 542 | ); |
544 | 543 | } |
545 | 544 | if ($def->optimized === null) { |
546 | 545 | $extra = $this->chatty ? " (try flushing your cache)" : ""; |
547 | 546 | throw new HTMLPurifier_Exception( |
548 | - "Optimization status of definition is unknown" . $extra |
|
547 | + "Optimization status of definition is unknown".$extra |
|
549 | 548 | ); |
550 | 549 | } |
551 | 550 | if ($def->optimized !== $optimized) { |
@@ -554,7 +553,7 @@ discard block |
||
554 | 553 | " (this backtrace is for the first inconsistent call, which was for a $msg raw definition)" |
555 | 554 | : ""; |
556 | 555 | throw new HTMLPurifier_Exception( |
557 | - "Inconsistent use of optimized and unoptimized raw definition retrievals" . $extra |
|
556 | + "Inconsistent use of optimized and unoptimized raw definition retrievals".$extra |
|
558 | 557 | ); |
559 | 558 | } |
560 | 559 | } |
@@ -586,16 +585,16 @@ discard block |
||
586 | 585 | } |
587 | 586 | // check invariants for creation |
588 | 587 | if (!$optimized) { |
589 | - if (!is_null($this->get($type . '.DefinitionID'))) { |
|
588 | + if (!is_null($this->get($type.'.DefinitionID'))) { |
|
590 | 589 | if ($this->chatty) { |
591 | 590 | $this->triggerError( |
592 | - 'Due to a documentation error in previous version of HTML Purifier, your ' . |
|
593 | - 'definitions are not being cached. If this is OK, you can remove the ' . |
|
594 | - '%$type.DefinitionRev and %$type.DefinitionID declaration. Otherwise, ' . |
|
595 | - 'modify your code to use maybeGetRawDefinition, and test if the returned ' . |
|
596 | - 'value is null before making any edits (if it is null, that means that a ' . |
|
597 | - 'cached version is available, and no raw operations are necessary). See ' . |
|
598 | - '<a href="http://htmlpurifier.org/docs/enduser-customize.html#optimized">' . |
|
591 | + 'Due to a documentation error in previous version of HTML Purifier, your '. |
|
592 | + 'definitions are not being cached. If this is OK, you can remove the '. |
|
593 | + '%$type.DefinitionRev and %$type.DefinitionID declaration. Otherwise, '. |
|
594 | + 'modify your code to use maybeGetRawDefinition, and test if the returned '. |
|
595 | + 'value is null before making any edits (if it is null, that means that a '. |
|
596 | + 'cached version is available, and no raw operations are necessary). See '. |
|
597 | + '<a href="http://htmlpurifier.org/docs/enduser-customize.html#optimized">'. |
|
599 | 598 | 'Customize</a> for more details', |
600 | 599 | E_USER_WARNING |
601 | 600 | ); |
@@ -689,7 +688,7 @@ discard block |
||
689 | 688 | $namespace = $key; |
690 | 689 | $namespace_values = $value; |
691 | 690 | foreach ($namespace_values as $directive => $value2) { |
692 | - $this->set($namespace .'.'. $directive, $value2); |
|
691 | + $this->set($namespace.'.'.$directive, $value2); |
|
693 | 692 | } |
694 | 693 | } |
695 | 694 | } |
@@ -898,7 +897,7 @@ discard block |
||
898 | 897 | break; |
899 | 898 | } |
900 | 899 | } |
901 | - trigger_error($msg . $extra, $no); |
|
900 | + trigger_error($msg.$extra, $no); |
|
902 | 901 | } |
903 | 902 | |
904 | 903 | /** |
@@ -133,7 +133,9 @@ |
||
133 | 133 | } |
134 | 134 | if (is_string($config)) { |
135 | 135 | $ret->loadIni($config); |
136 | - } elseif (is_array($config)) $ret->loadArray($config); |
|
136 | + } elseif (is_array($config)) { |
|
137 | + $ret->loadArray($config); |
|
138 | + } |
|
137 | 139 | return $ret; |
138 | 140 | } |
139 | 141 |
@@ -351,7 +351,7 @@ |
||
351 | 351 | } |
352 | 352 | |
353 | 353 | /** |
354 | - * @return bool |
|
354 | + * @return boolean|null |
|
355 | 355 | */ |
356 | 356 | public static function iconvAvailable() |
357 | 357 | { |
@@ -139,7 +139,7 @@ |
||
139 | 139 | } |
140 | 140 | |
141 | 141 | $mState = 0; // cached expected number of octets after the current octet |
142 | - // until the beginning of the next UTF8 character sequence |
|
142 | + // until the beginning of the next UTF8 character sequence |
|
143 | 143 | $mUcs4 = 0; // cached Unicode character |
144 | 144 | $mBytes = 1; // cached expected number of octets in the current sequence |
145 | 145 |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $mState = 0; |
274 | 274 | $mUcs4 = 0; |
275 | 275 | $mBytes = 1; |
276 | - $char =''; |
|
276 | + $char = ''; |
|
277 | 277 | } |
278 | 278 | } |
279 | 279 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | public static function unichr($code) |
310 | 310 | { |
311 | 311 | if ($code > 1114111 or $code < 0 or |
312 | - ($code >= 55296 and $code <= 57343) ) { |
|
312 | + ($code >= 55296 and $code <= 57343)) { |
|
313 | 313 | // bits are set outside the "valid" range as defined |
314 | 314 | // by UNICODE 4.1.0 |
315 | 315 | return ''; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $z = (($code >> 12) & 15) | 224; |
331 | 331 | } else { |
332 | 332 | $z = (($code >> 12) & 63) | 128; |
333 | - $w = (($code >> 18) & 7) | 240; |
|
333 | + $w = (($code >> 18) & 7) | 240; |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | } |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $str = self::unsafeIconv($encoding, 'utf-8//IGNORE', $str); |
385 | 385 | if ($str === false) { |
386 | 386 | // $encoding is not a valid encoding |
387 | - trigger_error('Invalid encoding ' . $encoding, E_USER_ERROR); |
|
387 | + trigger_error('Invalid encoding '.$encoding, E_USER_ERROR); |
|
388 | 388 | return ''; |
389 | 389 | } |
390 | 390 | // If the string is bjorked by Shift_JIS or a similar encoding |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | trigger_error('Encoding not supported, please install iconv', E_USER_ERROR); |
402 | 402 | } else { |
403 | 403 | trigger_error( |
404 | - 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 ' . |
|
404 | + 'You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 '. |
|
405 | 405 | 'and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', |
406 | 406 | E_USER_ERROR |
407 | 407 | ); |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | } |
443 | 443 | $str = strtr($str, array_flip($ascii_fix)); |
444 | 444 | // Normal stuff |
445 | - $str = self::iconv('utf-8', $encoding . '//IGNORE', $str); |
|
445 | + $str = self::iconv('utf-8', $encoding.'//IGNORE', $str); |
|
446 | 446 | return $str; |
447 | 447 | } elseif ($encoding === 'iso-8859-1') { |
448 | 448 | $str = utf8_decode($str); |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | $working += ($bytevalue & 0x3F); |
488 | 488 | $bytesleft--; |
489 | 489 | if ($bytesleft <= 0) { |
490 | - $result .= "&#" . $working . ";"; |
|
490 | + $result .= "&#".$working.";"; |
|
491 | 491 | } |
492 | 492 | } elseif ($bytevalue <= 0xDF) { //110x xxxx |
493 | 493 | $working = $bytevalue & 0x1F; |
@@ -533,14 +533,14 @@ discard block |
||
533 | 533 | static $code = null; |
534 | 534 | if ($code === null) { |
535 | 535 | // better not use iconv, otherwise infinite loop! |
536 | - $r = self::unsafeIconv('utf-8', 'ascii//IGNORE', "\xCE\xB1" . str_repeat('a', 9000)); |
|
536 | + $r = self::unsafeIconv('utf-8', 'ascii//IGNORE', "\xCE\xB1".str_repeat('a', 9000)); |
|
537 | 537 | if ($r === false) { |
538 | 538 | $code = self::ICONV_UNUSABLE; |
539 | 539 | } elseif (($c = strlen($r)) < 9000) { |
540 | 540 | $code = self::ICONV_TRUNCATES; |
541 | 541 | } elseif ($c > 9000) { |
542 | 542 | trigger_error( |
543 | - 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: ' . |
|
543 | + 'Your copy of iconv is extremely buggy. Please notify HTML Purifier maintainers: '. |
|
544 | 544 | 'include your iconv version as per phpversion()', |
545 | 545 | E_USER_ERROR |
546 | 546 | ); |
@@ -451,7 +451,7 @@ |
||
451 | 451 | * separate lists for processing. Format is element[attr1|attr2],element2... |
452 | 452 | * @warning Although it's largely drawn from TinyMCE's implementation, |
453 | 453 | * it is different, and you'll probably have to modify your lists |
454 | - * @param array $list String list to parse |
|
454 | + * @param string $list String list to parse |
|
455 | 455 | * @return array |
456 | 456 | * @todo Give this its own class, probably static interface |
457 | 457 | */ |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | if ($delete) { |
351 | 351 | if ($this->info[$tag]->attr[$attr]->required) { |
352 | 352 | trigger_error( |
353 | - "Required attribute '$attr' in element '$tag' " . |
|
353 | + "Required attribute '$attr' in element '$tag' ". |
|
354 | 354 | "was not allowed, which means '$tag' will not be allowed either", |
355 | 355 | E_USER_WARNING |
356 | 356 | ); |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $attribute = htmlspecialchars($bits[1]); |
371 | 371 | if (!isset($this->info[$element])) { |
372 | 372 | trigger_error( |
373 | - "Cannot allow attribute '$attribute' if element " . |
|
373 | + "Cannot allow attribute '$attribute' if element ". |
|
374 | 374 | "'$element' is not allowed/supported $support" |
375 | 375 | ); |
376 | 376 | } else { |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | } elseif (isset($forbidden_attributes["$tag.$attr"])) { // this segment might get removed eventually |
415 | 415 | // $tag.$attr are not user supplied, so no worries! |
416 | 416 | trigger_error( |
417 | - "Error with $tag.$attr: tag.attr syntax not supported for " . |
|
417 | + "Error with $tag.$attr: tag.attr syntax not supported for ". |
|
418 | 418 | "HTML.ForbiddenAttributes; use tag@attr instead", |
419 | 419 | E_USER_WARNING |
420 | 420 | ); |
@@ -118,7 +118,7 @@ |
||
118 | 118 | * the HTMLPurifier_ElementDef class. There is a similar function |
119 | 119 | * in HTMLPurifier_HTMLDefinition. |
120 | 120 | * @param HTMLPurifier_ElementDef $def |
121 | - * @return HTMLPurifier_ChildDef subclass |
|
121 | + * @return boolean subclass |
|
122 | 122 | */ |
123 | 123 | public function getChildDef($def) |
124 | 124 | { |
@@ -205,6 +205,7 @@ |
||
205 | 205 | /** |
206 | 206 | * Adds a module to the current doctype by first registering it, |
207 | 207 | * and then tacking it on to the active doctype |
208 | + * @param HTMLPurifier_HTMLModule $module |
|
208 | 209 | */ |
209 | 210 | public function addModule($module) |
210 | 211 | { |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $original_module = $module; |
175 | 175 | $ok = false; |
176 | 176 | foreach ($this->prefixes as $prefix) { |
177 | - $module = $prefix . $original_module; |
|
177 | + $module = $prefix.$original_module; |
|
178 | 178 | if (class_exists($module)) { |
179 | 179 | $ok = true; |
180 | 180 | break; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $module = $original_module; |
185 | 185 | if (!class_exists($module)) { |
186 | 186 | trigger_error( |
187 | - $original_module . ' module does not exist', |
|
187 | + $original_module.' module does not exist', |
|
188 | 188 | E_USER_ERROR |
189 | 189 | ); |
190 | 190 | return; |
@@ -193,11 +193,11 @@ discard block |
||
193 | 193 | $module = new $module(); |
194 | 194 | } |
195 | 195 | if (empty($module->name)) { |
196 | - trigger_error('Module instance of ' . get_class($module) . ' must have name'); |
|
196 | + trigger_error('Module instance of '.get_class($module).' must have name'); |
|
197 | 197 | return; |
198 | 198 | } |
199 | 199 | if (!$overload && isset($this->registeredModules[$module->name])) { |
200 | - trigger_error('Overloading ' . $module->name . ' without explicit overload parameter', E_USER_WARNING); |
|
200 | + trigger_error('Overloading '.$module->name.' without explicit overload parameter', E_USER_WARNING); |
|
201 | 201 | } |
202 | 202 | $this->registeredModules[$module->name] = $module; |
203 | 203 | } |
@@ -65,7 +65,7 @@ |
||
65 | 65 | * deleted a node, and now need to see if this change affected any |
66 | 66 | * earlier nodes. Rewinding does not affect other injectors, and can |
67 | 67 | * result in infinite loops if not used carefully. |
68 | - * @param bool|int $offset |
|
68 | + * @param integer $offset |
|
69 | 69 | * @warning HTML Purifier will prevent you from fast-forwarding with this |
70 | 70 | * function. |
71 | 71 | */ |
@@ -104,9 +104,9 @@ |
||
104 | 104 | if ($result !== false) { |
105 | 105 | return $result; |
106 | 106 | } |
107 | - $this->currentNesting =& $context->get('CurrentNesting'); |
|
108 | - $this->currentToken =& $context->get('CurrentToken'); |
|
109 | - $this->inputZipper =& $context->get('InputZipper'); |
|
107 | + $this->currentNesting = & $context->get('CurrentNesting'); |
|
108 | + $this->currentToken = & $context->get('CurrentToken'); |
|
109 | + $this->inputZipper = & $context->get('InputZipper'); |
|
110 | 110 | return false; |
111 | 111 | } |
112 | 112 |
@@ -328,7 +328,7 @@ |
||
328 | 328 | * Determines if a particular token requires an earlier inline token |
329 | 329 | * to get a paragraph. This should be used with _forwardUntilEndToken |
330 | 330 | * @param HTMLPurifier_Token $current |
331 | - * @return bool |
|
331 | + * @return boolean|null |
|
332 | 332 | */ |
333 | 333 | private function _checkNeedsP($current) |
334 | 334 | { |
@@ -341,6 +341,7 @@ |
||
341 | 341 | /** |
342 | 342 | * Takes a string of HTML (fragment or document) and returns the content |
343 | 343 | * @todo Consider making protected |
344 | + * @param string $html |
|
344 | 345 | */ |
345 | 346 | public function extractBody($html) |
346 | 347 | { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | break; |
125 | 125 | default: |
126 | 126 | throw new HTMLPurifier_Exception( |
127 | - "Cannot instantiate unrecognized Lexer type " . |
|
127 | + "Cannot instantiate unrecognized Lexer type ". |
|
128 | 128 | htmlspecialchars($lexer) |
129 | 129 | ); |
130 | 130 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | // hack out something using XSLT, remove this stipulation |
139 | 139 | if ($needs_tracking && !$inst->tracksLineNumbers) { |
140 | 140 | throw new HTMLPurifier_Exception( |
141 | - 'Cannot use lexer that does not support line numbers with ' . |
|
141 | + 'Cannot use lexer that does not support line numbers with '. |
|
142 | 142 | 'Core.MaintainLineNumbers or Core.CollectErrors (use DirectLex instead)' |
143 | 143 | ); |
144 | 144 | } |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | if ($config->get('Core.ConvertDocumentToFragment')) { |
314 | 314 | $e = false; |
315 | 315 | if ($config->get('Core.CollectErrors')) { |
316 | - $e =& $context->get('ErrorCollector'); |
|
316 | + $e = & $context->get('ErrorCollector'); |
|
317 | 317 | } |
318 | 318 | $new_html = $this->extractBody($html); |
319 | 319 | if ($e && $new_html != $html) { |
@@ -458,6 +458,9 @@ discard block |
||
458 | 458 | const CHARACTR = 4; |
459 | 459 | const EOF = 5; |
460 | 460 | |
461 | + /** |
|
462 | + * @param string $data |
|
463 | + */ |
|
461 | 464 | public function __construct($data) |
462 | 465 | { |
463 | 466 | $this->data = $data; |
@@ -478,6 +481,9 @@ discard block |
||
478 | 481 | return $this->tree->save(); |
479 | 482 | } |
480 | 483 | |
484 | + /** |
|
485 | + * @return string |
|
486 | + */ |
|
481 | 487 | private function char() |
482 | 488 | { |
483 | 489 | return ($this->char < $this->EOF) |
@@ -485,6 +491,11 @@ discard block |
||
485 | 491 | : false; |
486 | 492 | } |
487 | 493 | |
494 | + /** |
|
495 | + * @param integer $s |
|
496 | + * |
|
497 | + * @return string |
|
498 | + */ |
|
488 | 499 | private function character($s, $l = 0) |
489 | 500 | { |
490 | 501 | if ($s + $l < $this->EOF) { |
@@ -496,6 +507,10 @@ discard block |
||
496 | 507 | } |
497 | 508 | } |
498 | 509 | |
510 | + /** |
|
511 | + * @param string $char_class |
|
512 | + * @param integer $start |
|
513 | + */ |
|
499 | 514 | private function characters($char_class, $start) |
500 | 515 | { |
501 | 516 | return preg_replace('#^([' . $char_class . ']+).*#s', '\\1', substr($this->data, $start)); |
@@ -4645,6 +4660,9 @@ discard block |
||
4645 | 4660 | } |
4646 | 4661 | } |
4647 | 4662 | |
4663 | + /** |
|
4664 | + * @param string[] $elements |
|
4665 | + */ |
|
4648 | 4666 | private function clearStackToTableContext($elements) |
4649 | 4667 | { |
4650 | 4668 | /* When the steps above require the UA to clear the stack back to a |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $this->state = 'data'; |
470 | 470 | |
471 | 471 | while ($this->state !== null) { |
472 | - $this->{$this->state . 'State'}(); |
|
472 | + $this->{$this->state.'State'}(); |
|
473 | 473 | } |
474 | 474 | } |
475 | 475 | |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | |
499 | 499 | private function characters($char_class, $start) |
500 | 500 | { |
501 | - return preg_replace('#^([' . $char_class . ']+).*#s', '\\1', substr($this->data, $start)); |
|
501 | + return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start)); |
|
502 | 502 | } |
503 | 503 | |
504 | 504 | private function dataState() |
@@ -1289,7 +1289,7 @@ discard block |
||
1289 | 1289 | } else { |
1290 | 1290 | /* Append a U+002D HYPHEN-MINUS (-) character and the input |
1291 | 1291 | character to the comment token's data. Switch to the comment state. */ |
1292 | - $this->token['data'] .= '-' . $char; |
|
1292 | + $this->token['data'] .= '-'.$char; |
|
1293 | 1293 | $this->state = 'comment'; |
1294 | 1294 | } |
1295 | 1295 | } |
@@ -1313,7 +1313,7 @@ discard block |
||
1313 | 1313 | $this->state = 'data'; |
1314 | 1314 | |
1315 | 1315 | } else { |
1316 | - $this->token['data'] .= '--' . $char; |
|
1316 | + $this->token['data'] .= '--'.$char; |
|
1317 | 1317 | $this->state = 'comment'; |
1318 | 1318 | } |
1319 | 1319 | } |
@@ -1547,7 +1547,7 @@ discard block |
||
1547 | 1547 | |
1548 | 1548 | // Return a character token for the character corresponding to the |
1549 | 1549 | // entity name (as given by the second column of the entities table). |
1550 | - return html_entity_decode('&' . $entity . ';', ENT_QUOTES, 'UTF-8'); |
|
1550 | + return html_entity_decode('&'.$entity.';', ENT_QUOTES, 'UTF-8'); |
|
1551 | 1551 | } |
1552 | 1552 | |
1553 | 1553 | private function emitToken($token) |
@@ -2656,7 +2656,7 @@ discard block |
||
2656 | 2656 | |
2657 | 2657 | /* Act as if a stream of character tokens had been seen. */ |
2658 | 2658 | $this->insertText( |
2659 | - 'This is a searchable index. ' . |
|
2659 | + 'This is a searchable index. '. |
|
2660 | 2660 | 'Insert your search keywords here: ' |
2661 | 2661 | ); |
2662 | 2662 | |
@@ -2678,7 +2678,7 @@ discard block |
||
2678 | 2678 | /* Act as if a stream of character tokens had been seen |
2679 | 2679 | (see below for what they should say). */ |
2680 | 2680 | $this->insertText( |
2681 | - 'This is a searchable index. ' . |
|
2681 | + 'This is a searchable index. '. |
|
2682 | 2682 | 'Insert your search keywords here: ' |
2683 | 2683 | ); |
2684 | 2684 |