Current file: htdocs/lib/Varien/Exception.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 1 CRAP
18.75%18.75%
18.75% 3 / 16
 
Varien_Exception
0.00%0.00%
0.00% 0 / 1
0.00%0.00%
0.00% 0 / 1
18.75%18.75%
18.75% 3 / 16
 processPcreError()
0.00%0.00%
0.00% 0 / 1 38.90
13.33%13.33%
13.33% 2 / 15


       1                 : <?php                                                                                      
       2                 : /**                                                                                        
       3                 :  * Magento                                                                                 
       4                 :  *                                                                                         
       5                 :  * NOTICE OF LICENSE                                                                       
       6                 :  *                                                                                         
       7                 :  * This source file is subject to the Open Software License (OSL 3.0)                      
       8                 :  * that is bundled with this package in the file LICENSE.txt.                              
       9                 :  * It is also available through the world-wide-web at this URL:                            
      10                 :  * http://opensource.org/licenses/osl-3.0.php                                              
      11                 :  * If you did not receive a copy of the license and are unable to                          
      12                 :  * obtain it through the world-wide-web, please send an email                              
      13                 :  * to license@magentocommerce.com so we can send you a copy immediately.                   
      14                 :  *                                                                                         
      15                 :  * DISCLAIMER                                                                              
      16                 :  *                                                                                         
      17                 :  * Do not edit or add to this file if you wish to upgrade Magento to newer                 
      18                 :  * versions in the future. If you wish to customize Magento for your                       
      19                 :  * needs please refer to http://www.magentocommerce.com for more information.              
      20                 :  *                                                                                         
      21                 :  * @category   Varien                                                                      
      22                 :  * @package    Varien_Exception                                                            
      23                 :  * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
      24                 :  * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0) 
      25                 :  */                                                                                        
      26                 :                                                                                            
      27                 :                                                                                            
      28                 : class Varien_Exception extends Exception                                                   
      29               1 : {                                                                                          
      30                 :     /**                                                                                    
      31                 :      * Check PCRE PREG error and throw exception                                           
      32                 :      *                                                                                     
      33                 :      * @throws Varien_Exception                                                            
      34                 :      */                                                                                    
      35                 :     public static function processPcreError()                                              
      36                 :     {                                                                                      
      37               1 :         if (preg_last_error() != PREG_NO_ERROR) {                                          
      38               0 :             switch (preg_last_error()) {                                                   
      39               0 :                 case PREG_INTERNAL_ERROR:                                                  
      40               0 :                     throw new Varien_Exception('PCRE PREG internal error');                
      41               0 :                 case PREG_BACKTRACK_LIMIT_ERROR:                                           
      42               0 :                     throw new Varien_Exception('PCRE PREG Backtrack limit error');         
      43               0 :                 case PREG_RECURSION_LIMIT_ERROR:                                           
      44               0 :                     throw new Varien_Exception('PCRE PREG Recursion limit error');         
      45               0 :                 case PREG_BAD_UTF8_ERROR:                                                  
      46               0 :                     throw new Varien_Exception('PCRE PREG Bad UTF-8 error');               
      47               0 :                 case PREG_BAD_UTF8_OFFSET_ERROR:                                           
      48               0 :                     throw new Varien_Exception('PCRE PREG Bad UTF-8 offset error');        
      49               0 :             }                                                                              
      50               0 :         }                                                                                  
      51               1 :     }                                                                                      
      52                 : }                                                                                          

Generated by PHP_CodeCoverage 1.0.4 using PHP 5.3.4 and PHPUnit 3.5.13 at Tue Jul 5 9:07:16 UTC 2011.