PHPIDS
Current file: /home/mario/workspace/php-ids.org/trunk/lib/IDS/vendors/htmlpurifier/HTMLPurifier/ChildDef/Optional.php
Legend: executed not executed dead code

  Coverage
  Classes Methods Lines
Total
100.00 %100.00%
100.00% 1 / 1
100.00 %100.00%
100.00% 1 / 1
100.00 %100.00%
100.00% 5 / 5
 
HTMLPurifier_ChildDef_Optional
100.00 %100.00%
100.00% 1 / 1
100.00 %100.00%
100.00% 1 / 1
100.00 %100.00%
100.00% 5 / 5
 public function validateChildren($tokens_of_children, $config, $context)
100.00 %100.00%
100.00% 1 / 1
100.00 %100.00%
100.00% 4 / 4


       1                 : <?php                                                                              
       2                 :                                                                                    
       3                 : /**                                                                                
       4                 :  * Definition that allows a set of elements, and allows no children.               
       5                 :  * @note This is a hack to reuse code from HTMLPurifier_ChildDef_Required,         
       6                 :  *       really, one shouldn't inherit from the other.  Only altered behavior      
       7                 :  *       is to overload a returned false with an array.  Thus, it will never       
       8                 :  *       return false.                                                             
       9                 :  */                                                                                
      10               1 : class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required        
      11                 : {                                                                                  
      12                 :     public $allow_empty = true;                                                    
      13                 :     public $type = 'optional';                                                     
      14                 :     public function validateChildren($tokens_of_children, $config, $context) {     
      15               2 :         $result = parent::validateChildren($tokens_of_children, $config, $context);
      16               2 :         if ($result === false) {                                                   
      17               2 :             if (empty($tokens_of_children)) return true;                           
      18                 :             else return array();                                                   
      19                 :         }                                                                          
      20               2 :         return $result;                                                            
      21                 :     }                                                                              
      22                 : }                                                                                  
      23                 :                                                                                    

Generated by PHPUnit 3.3.1 and Xdebug 2.0.2 at Thu Sep 25 18:42:10 CEST 2008.