System.php
Current file: /home/nuno/workspace/phmagick/phMagick/Core/System.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
100.00% 1 / 1
100.00% 4 / 4 CRAP
100.00% 14 / 14
System
100.00% 1 / 1
100.00% 6 / 6 7
100.00% 14 / 14
 getRunner()
100.00% 1 / 1 1
100.00% 6 / 6
 getLogger()
100.00% 1 / 1 1
100.00% 1 / 1
 getSettings()
100.00% 1 / 1 1
100.00% 2 / 2
 getVar($name)
100.00% 1 / 1 2
100.00% 5 / 5
 add(Action $action)
100.00% 1 / 1 1
100.00% 0 / 0
 execute()
100.00% 1 / 1 1
100.00% 0 / 0


       1                 : <?php                                                                       
       2                 : namespace phMagick\Core;                                                    
       3                 :                                                                             
       4                 : class System                                                                
       5                 : {                                                                           
       6                 :     private $actions = array();                                             
       7                 :     private $runner = null;                                                 
       8                 :     private $settings = null;                                               
       9                 :     private $logger = null;                                                 
      10                 :                                                                             
      11                 :     public function getRunner()                                             
      12                 :     {                                                                       
      13               1 :         $settings = $this->getSettings();                                   
      14               1 :         $logger   = $this->getLogger();                                     
      15               1 :         $runner = $this->getVar('runner');                                  
      16                 :                                                                             
      17               1 :         $runner->debug($settings->isDebug());                               
      18               1 :         $runner->setLogger($logger);                                        
      19               1 :         return $runner;                                                     
      20                 :     }                                                                       
      21                 :                                                                             
      22                 :     public function getLogger()                                             
      23                 :     {                                                                       
      24               2 :         return $this->getVar('logger');                                     
      25                 :     }                                                                       
      26                 :                                                                             
      27                 :     public function getSettings()                                           
      28                 :     {                                                                       
      29               2 :         $settings = $this->getVar('settings');                              
      30               2 :         return $settings->getInstance();                                    
      31                 :     }                                                                       
      32                 :                                                                             
      33                 :     private function getVar($name) {                                        
      34               3 :         if (is_null($this->$name)) {                                        
      35               3 :             $class = 'phMagick\Core\\' . ucfirst($name);                    
      36               3 :             $this->$name = &new $class();                                   
      37               3 :         }                                                                   
      38                 :                                                                             
      39               3 :         return $this->$name;                                                
      40                 :     }                                                                       
      41                 :                                                                             
      42                 :     /**                                                                     
      43                 :      * Adds an action to the action stack                                   
      44                 :      * @param Action $action                                                
      45                 :      */                                                                     
      46                 :     public function add(Action $action)                                     
      47                 :     {                                                                       
      48                 :         $this->actions[] = $action;                                         
      49                 :     }                                                                       
      50                 :                                                                             
      51                 :     /**                                                                     
      52                 :      *                                                                      
      53                 :      * Executes the actions on the stack                                    
      54                 :      * destination of one action becomes the source of another action, so we
      55                 :      * can chain several actions together                                   
      56                 :      */                                                                     
      57                 :     public function execute()                                               
      58                 :     {                                                                       
      59                 :                                                                             
      60                 :     }                                                                       

Generated by PHP_CodeCoverage 1.1.1 using PHP 5.3.10 and PHPUnit 3.6.7 at Fri Apr 20 19:24:32 CEST 2012.