InstanceResource.php
Current file: /Users/kevin/code/twilio-php/Services/Twilio/InstanceResource.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
0.00% 0 / 1
66.67% 2 / 3 CRAP
80.00% 8 / 10
Services_Twilio_InstanceResource
0.00% 0 / 1
66.67% 2 / 3 5.20
80.00% 8 / 10
 update($params, $value = null)
100.00% 1 / 1 2
100.00% 5 / 5
 setProxy($proxy)
0.00% 0 / 1 2
0.00% 0 / 2
 __get($key)
100.00% 1 / 1 2
100.00% 3 / 3


       1                 : <?php                                                                  
       2                 :                                                                        
       3                 : /**                                                                    
       4                 :  * Abstraction of an instance resource from the Twilio API.            
       5                 :  *                                                                     
       6                 :  * @category Services                                                  
       7                 :  * @package  Services_Twilio                                           
       8                 :  * @author   Neuman Vong <neuman@twilio.com>                           
       9                 :  * @license  http://creativecommons.org/licenses/MIT/ MIT              
      10                 :  * @link     http://pear.php.net/package/Services_Twilio               
      11                 :  */                                                                    
      12                 : abstract class Services_Twilio_InstanceResource                        
      13                 :     extends Services_Twilio_Resource                                   
      14                 : {                                                                      
      15                 :     /**                                                                
      16                 :      * @param mixed $params An array of updates, or a property name    
      17                 :      * @param mixed $value  A value with which to update the resource  
      18                 :      *                                                                 
      19                 :      * @return null                                                    
      20                 :      */                                                                
      21                 :     public function update($params, $value = null)                     
      22                 :     {                                                                  
      23               6 :         if (!is_array($params)) {                                      
      24               5 :             $params = array($params => $value);                        
      25               5 :         }                                                              
      26               6 :         $this->proxy->updateData($params);                             
      27               6 :     }                                                                  
      28                 :                                                                        
      29                 :     /**                                                                
      30                 :      * Set this resource's proxy.                                      
      31                 :      *                                                                 
      32                 :      * @param Services_Twilio_DataProxy $proxy An instance of DataProxy
      33                 :      *                                                                 
      34                 :      * @return null                                                    
      35                 :      */                                                                
      36                 :     public function setProxy($proxy)                                   
      37                 :     {                                                                  
      38               0 :         $this->proxy = $proxy;                                         
      39               0 :     }                                                                  
      40                 :                                                                        
      41                 :     /**                                                                
      42                 :      * Get the value of a property on this resource.                   
      43                 :      *                                                                 
      44                 :      * @param string $key The property name                            
      45                 :      *                                                                 
      46                 :      * @return mixed Could be anything.                                
      47                 :      */                                                                
      48                 :     public function __get($key)                                        
      49                 :     {                                                                  
      50              25 :         if ($subresource = $this->getSubresources($key)) {             
      51              19 :             return $subresource;                                       
      52                 :         }                                                              
      53              19 :         return $this->proxy->$key;                                     
      54                 :     }                                                                  
      55                 : }                                                                      

Generated by PHP_CodeCoverage 1.1.2 using PHP 5.3.13 and PHPUnit 3.6.11 at Mon Jun 4 22:46:14 PDT 2012.