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

  Coverage
  Classes Methods Lines
Total
100.00 %100.00%
100.00% 1 / 1
0.00 %0.00%
0.00% 0 / 2
16.67 %16.67%
16.67% 1 / 6
 
HTMLPurifier_ChildDef_Chameleon
100.00 %100.00%
100.00% 1 / 1
0.00 %0.00%
0.00% 0 / 2
16.67 %16.67%
16.67% 1 / 6
 public function __construct($inline, $block)
0.00 %0.00%
0.00% 0 / 1
100.00 %100.00%
100.00% 0 / 0
 public function validateChildren($tokens_of_children, $config, $context)
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 5


       1                 : <?php                                                                         
       2                 :                                                                               
       3                 : /**                                                                           
       4                 :  * Definition that uses different definitions depending on context.           
       5                 :  *                                                                            
       6                 :  * The del and ins tags are notable because they allow different types of     
       7                 :  * elements depending on whether or not they're in a block or inline context. 
       8                 :  * Chameleon allows this behavior to happen by using two different            
       9                 :  * definitions depending on context.  While this somewhat generalized,        
      10                 :  * it is specifically intended for those two tags.                            
      11                 :  */                                                                           
      12               1 : class HTMLPurifier_ChildDef_Chameleon extends HTMLPurifier_ChildDef           
      13                 : {                                                                             
      14                 :                                                                               
      15                 :     /**                                                                       
      16                 :      * Instance of the definition object to use when inline. Usually stricter.
      17                 :      */                                                                       
      18                 :     public $inline;                                                           
      19                 :                                                                               
      20                 :     /**                                                                       
      21                 :      * Instance of the definition object to use when block.                   
      22                 :      */                                                                       
      23                 :     public $block;                                                            
      24                 :                                                                               
      25                 :     public $type = 'chameleon';                                               
      26                 :                                                                               
      27                 :     /**                                                                       
      28                 :      * @param $inline List of elements to allow when inline.                  
      29                 :      * @param $block List of elements to allow when block.                    
      30                 :      */                                                                       
      31                 :     public function __construct($inline, $block) {                            
      32                 :         $this->inline = new HTMLPurifier_ChildDef_Optional($inline);          
      33                 :         $this->block  = new HTMLPurifier_ChildDef_Optional($block);           
      34                 :         $this->elements = $this->block->elements;                             
      35                 :     }                                                                         
      36                 :                                                                               
      37                 :     public function validateChildren($tokens_of_children, $config, $context) {
      38               0 :         if ($context->get('IsInline') === false) {                            
      39               0 :             return $this->block->validateChildren(                            
      40               0 :                 $tokens_of_children, $config, $context);                      
      41                 :         } else {                                                              
      42               0 :             return $this->inline->validateChildren(                           
      43               0 :                 $tokens_of_children, $config, $context);                      
      44                 :         }                                                                     
      45                 :     }                                                                         
      46                 : }                                                                             
      47                 :                                                                               

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