@@ -9,6 +9,11 @@ discard block |
||
9 | 9 | */ |
10 | 10 | class HTMLPurifier_Arborize |
11 | 11 | { |
12 | + /** |
|
13 | + * @param HTMLPurifier_Token[] $tokens |
|
14 | + * @param HTMLPurifier_Config $config |
|
15 | + * @param HTMLPurifier_Context $context |
|
16 | + */ |
|
12 | 17 | public static function arborize($tokens, $config, $context) { |
13 | 18 | $definition = $config->getHTMLDefinition(); |
14 | 19 | $parent = new HTMLPurifier_Token_Start($definition->info_parent); |
@@ -36,6 +41,10 @@ discard block |
||
36 | 41 | return $stack[0]; |
37 | 42 | } |
38 | 43 | |
44 | + /** |
|
45 | + * @param HTMLPurifier_Config $config |
|
46 | + * @param HTMLPurifier_Context $context |
|
47 | + */ |
|
39 | 48 | public static function flatten($node, $config, $context) { |
40 | 49 | $level = 0; |
41 | 50 | $nodes = array($level => new HTMLPurifier_Queue(array($node))); |
@@ -56,6 +56,7 @@ discard block |
||
56 | 56 | * 4.7. However, note that we are NOT necessarily |
57 | 57 | * parsing XML, thus, this behavior may still be correct. We |
58 | 58 | * assume that newlines have been normalized. |
59 | + * @param string $string |
|
59 | 60 | */ |
60 | 61 | public function parseCDATA($string) |
61 | 62 | { |
@@ -92,6 +93,7 @@ discard block |
||
92 | 93 | /** |
93 | 94 | * Parses a possibly escaped CSS string and returns the "pure" |
94 | 95 | * version of it. |
96 | + * @param string $string |
|
95 | 97 | */ |
96 | 98 | protected function expandCSSEscape($string) |
97 | 99 | { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | * |
292 | 292 | * @param string $key key |
293 | 293 | * @param mixed $value value |
294 | - * @param mixed $a |
|
294 | + * @param string $a |
|
295 | 295 | */ |
296 | 296 | public function set($key, $value, $a = null) |
297 | 297 | { |
@@ -763,7 +763,7 @@ discard block |
||
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 | { |
@@ -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 | { |
@@ -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 | { |
@@ -528,9 +528,10 @@ discard block |
||
528 | 528 | * being the current one) will be deleted. |
529 | 529 | * |
530 | 530 | * @param HTMLPurifier_Token|array|int|bool $token Token substitution value |
531 | - * @param HTMLPurifier_Injector|int $injector Injector that performed the substitution; default is if |
|
531 | + * @param integer $injector Injector that performed the substitution; default is if |
|
532 | 532 | * this is not an injector related operation. |
533 | 533 | * @throws HTMLPurifier_Exception |
534 | + * @return HTMLPurifier_Token |
|
534 | 535 | */ |
535 | 536 | protected function processToken($token, $injector = -1) |
536 | 537 | { |
@@ -577,6 +578,7 @@ discard block |
||
577 | 578 | * Inserts a token before the current token. Cursor now points to |
578 | 579 | * this token. You must reprocess after this. |
579 | 580 | * @param HTMLPurifier_Token $token |
581 | + * @return HTMLPurifier_Token |
|
580 | 582 | */ |
581 | 583 | private function insertBefore($token) |
582 | 584 | { |
@@ -104,7 +104,7 @@ |
||
104 | 104 | /** |
105 | 105 | * Initializes the purifier. |
106 | 106 | * |
107 | - * @param HTMLPurifier_Config|mixed $config Optional HTMLPurifier_Config object |
|
107 | + * @param HTMLPurifier_Config $config Optional HTMLPurifier_Config object |
|
108 | 108 | * for all instances of the purifier, if omitted, a default |
109 | 109 | * configuration is supplied (which can be overridden on a |
110 | 110 | * per-use basis). |
@@ -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 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * @param string $css |
19 | 19 | * @param HTMLPurifier_Config $config |
20 | 20 | * @param HTMLPurifier_Context $context |
21 | - * @return bool|string |
|
21 | + * @return string|false |
|
22 | 22 | */ |
23 | 23 | public function validate($css, $config, $context) |
24 | 24 | { |