mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 06:07:26 +02:00
PSR-2 reformatting PHPDoc corrections
With minor corrections. Signed-off-by: Marcus Bointon <marcus@synchromedia.co.uk> Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
committed by
Edward Z. Yang
parent
19eee14899
commit
fac747bdbd
@@ -9,15 +9,34 @@
|
||||
*/
|
||||
class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required
|
||||
{
|
||||
/**
|
||||
* @type bool
|
||||
*/
|
||||
public $allow_empty = true;
|
||||
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
public $type = 'optional';
|
||||
public function validateChildren($tokens_of_children, $config, $context) {
|
||||
|
||||
/**
|
||||
* @param array $tokens_of_children
|
||||
* @param HTMLPurifier_Config $config
|
||||
* @param HTMLPurifier_Context $context
|
||||
* @return array
|
||||
*/
|
||||
public function validateChildren($tokens_of_children, $config, $context)
|
||||
{
|
||||
$result = parent::validateChildren($tokens_of_children, $config, $context);
|
||||
// we assume that $tokens_of_children is not modified
|
||||
if ($result === false) {
|
||||
if (empty($tokens_of_children)) return true;
|
||||
elseif ($this->whitespace) return $tokens_of_children;
|
||||
else return array();
|
||||
if (empty($tokens_of_children)) {
|
||||
return true;
|
||||
} elseif ($this->whitespace) {
|
||||
return $tokens_of_children;
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user