PHPIDS
Current file: /home/mario/workspace/php-ids.org/trunk/lib/IDS/vendors/htmlpurifier/HTMLPurifier/AttrTransform/Lang.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
66.67 %66.67%
66.67% 6 / 9
 
HTMLPurifier_AttrTransform_Lang
100.00 %100.00%
100.00% 1 / 1
100.00 %100.00%
100.00% 1 / 1
66.67 %66.67%
66.67% 6 / 9
 public function transform($attr, $config, $context)
100.00 %100.00%
100.00% 1 / 1
62.50 %62.50%
62.50% 5 / 8


       1                 : <?php                                                                      
       2                 :                                                                            
       3                 : /**                                                                        
       4                 :  * Post-transform that copies lang's value to xml:lang (and vice-versa)    
       5                 :  * @note Theoretically speaking, this could be a pre-transform, but putting
       6                 :  *       post is more efficient.                                           
       7                 :  */                                                                        
       8               1 : class HTMLPurifier_AttrTransform_Lang extends HTMLPurifier_AttrTransform   
       9                 : {                                                                          
      10                 :                                                                            
      11                 :     public function transform($attr, $config, $context) {                  
      12                 :                                                                            
      13               2 :         $lang     = isset($attr['lang']) ? $attr['lang'] : false;          
      14               2 :         $xml_lang = isset($attr['xml:lang']) ? $attr['xml:lang'] : false;  
      15                 :                                                                            
      16               2 :         if ($lang !== false && $xml_lang === false) {                      
      17               0 :             $attr['xml:lang'] = $lang;                                     
      18               2 :         } elseif ($xml_lang !== false) {                                   
      19               0 :             $attr['lang'] = $xml_lang;                                     
      20               0 :         }                                                                  
      21                 :                                                                            
      22               2 :         return $attr;                                                      
      23                 :                                                                            
      24                 :     }                                                                      
      25                 :                                                                            
      26                 : }                                                                          
      27                 :                                                                            

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