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

  Coverage
  Classes Methods Lines
Total
100.00 %100.00%
100.00% 1 / 1
50.00 %50.00%
50.00% 1 / 2
50.00 %50.00%
50.00% 4 / 8
 
HTMLPurifier_AttrTransform_BoolToCSS
100.00 %100.00%
100.00% 1 / 1
50.00 %50.00%
50.00% 1 / 2
50.00 %50.00%
50.00% 4 / 8
 public function __construct($attr, $css)
100.00 %100.00%
100.00% 1 / 1
100.00 %100.00%
100.00% 3 / 3
 public function transform($attr, $config, $context)
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 4


       1                 : <?php                                                                          
       2                 :                                                                                
       3                 : /**                                                                            
       4                 :  * Pre-transform that changes converts a boolean attribute to fixed CSS        
       5                 :  */                                                                            
       6               1 : class HTMLPurifier_AttrTransform_BoolToCSS extends HTMLPurifier_AttrTransform {
       7                 :                                                                                
       8                 :     /**                                                                        
       9                 :      * Name of boolean attribute that is trigger                               
      10                 :      */                                                                        
      11                 :     protected $attr;                                                           
      12                 :                                                                                
      13                 :     /**                                                                        
      14                 :      * CSS declarations to add to style, needs trailing semicolon              
      15                 :      */                                                                        
      16                 :     protected $css;                                                            
      17                 :                                                                                
      18                 :     /**                                                                        
      19                 :      * @param $attr string attribute name to convert from                      
      20                 :      * @param $css string CSS declarations to add to style (needs semicolon)   
      21                 :      */                                                                        
      22                 :     public function __construct($attr, $css) {                                 
      23               1 :         $this->attr = $attr;                                                   
      24               1 :         $this->css  = $css;                                                    
      25               1 :     }                                                                          
      26                 :                                                                                
      27                 :     public function transform($attr, $config, $context) {                      
      28               0 :         if (!isset($attr[$this->attr])) return $attr;                          
      29               0 :         unset($attr[$this->attr]);                                             
      30               0 :         $this->prependCSS($attr, $this->css);                                  
      31               0 :         return $attr;                                                          
      32                 :     }                                                                          
      33                 :                                                                                
      34                 : }                                                                              
      35                 :                                                                                

Generated by PHPUnit 3.2.20 and Xdebug 2.0.3 at Sat Jun 7 16:15:42 CEST 2008.