PHPIDS
Current file: /home/mario/workspace/php-ids.org/trunk/lib/IDS/vendors/htmlpurifier/HTMLPurifier/AttrDef/CSS/Border.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
5.56 %5.56%
5.56% 1 / 18
 
HTMLPurifier_AttrDef_CSS_Border
100.00 %100.00%
100.00% 1 / 1
0.00 %0.00%
0.00% 0 / 2
5.56 %5.56%
5.56% 1 / 18
 public function __construct($config)
0.00 %0.00%
0.00% 0 / 1
100.00 %100.00%
100.00% 0 / 0
 public function validate($string, $config, $context)
0.00 %0.00%
0.00% 0 / 1
0.00 %0.00%
0.00% 0 / 17


       1                 : <?php                                                                    
       2                 :                                                                          
       3                 : /**                                                                      
       4                 :  * Validates the border property as defined by CSS.                      
       5                 :  */                                                                      
       6               1 : class HTMLPurifier_AttrDef_CSS_Border extends HTMLPurifier_AttrDef       
       7                 : {                                                                        
       8                 :                                                                          
       9                 :     /**                                                                  
      10                 :      * Local copy of properties this property is shorthand for.          
      11                 :      */                                                                  
      12                 :     protected $info = array();                                           
      13                 :                                                                          
      14                 :     public function __construct($config) {                               
      15                 :         $def = $config->getCSSDefinition();                              
      16                 :         $this->info['border-width'] = $def->info['border-width'];        
      17                 :         $this->info['border-style'] = $def->info['border-style'];        
      18                 :         $this->info['border-top-color'] = $def->info['border-top-color'];
      19                 :     }                                                                    
      20                 :                                                                          
      21                 :     public function validate($string, $config, $context) {               
      22               0 :         $string = $this->parseCDATA($string);                            
      23               0 :         $string = $this->mungeRgb($string);                              
      24               0 :         $bits = explode(' ', $string);                                   
      25               0 :         $done = array(); // segments we've finished                      
      26               0 :         $ret = ''; // return value                                       
      27               0 :         foreach ($bits as $bit) {                                        
      28               0 :             foreach ($this->info as $propname => $validator) {           
      29               0 :                 if (isset($done[$propname])) continue;                   
      30               0 :                 $r = $validator->validate($bit, $config, $context);      
      31               0 :                 if ($r !== false) {                                      
      32               0 :                     $ret .= $r . ' ';                                    
      33               0 :                     $done[$propname] = true;                             
      34               0 :                     break;                                               
      35               0 :                 }                                                        
      36               0 :             }                                                            
      37               0 :         }                                                                
      38               0 :         return rtrim($ret);                                              
      39                 :     }                                                                    
      40                 :                                                                          
      41                 : }                                                                        
      42                 :                                                                          

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