PHPIDS
Current file: /home/mario/workspace/php-ids.org/trunk/lib/IDS/vendors/htmlpurifier/HTMLPurifier/AttrTransform/Length.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
44.44 %44.44%
44.44% 4 / 9
 
HTMLPurifier_AttrTransform_Length
100.00 %100.00%
100.00% 1 / 1
50.00 %50.00%
50.00% 1 / 2
44.44 %44.44%
44.44% 4 / 9
 public function __construct($name, $css_name = NULL)
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 / 5


       1                 : <?php                                                                     
       2                 :                                                                           
       3                 : /**                                                                       
       4                 :  * Class for handling width/height length attribute transformations to CSS
       5                 :  */                                                                       
       6               1 : class HTMLPurifier_AttrTransform_Length extends HTMLPurifier_AttrTransform
       7                 : {                                                                         
       8                 :                                                                           
       9                 :     protected $name;                                                      
      10                 :     protected $cssName;                                                   
      11                 :                                                                           
      12                 :     public function __construct($name, $css_name = null) {                
      13               1 :         $this->name = $name;                                              
      14               1 :         $this->cssName = $css_name ? $css_name : $name;                   
      15               1 :     }                                                                     
      16                 :                                                                           
      17                 :     public function transform($attr, $config, $context) {                 
      18               0 :         if (!isset($attr[$this->name])) return $attr;                     
      19               0 :         $length = $this->confiscateAttr($attr, $this->name);              
      20               0 :         if(ctype_digit($length)) $length .= 'px';                         
      21               0 :         $this->prependCSS($attr, $this->cssName . ":$length;");           
      22               0 :         return $attr;                                                     
      23                 :     }                                                                     
      24                 :                                                                           
      25                 : }                                                                         
      26                 :                                                                           

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