Example #1
0
 public function __get($name)
 {
     if ($this->__resp->code != 200 && $name !== 'responseText') {
         EpiOAuthException::raise($this->__resp->data, $this->__resp->code);
     }
     $this->responseText = $this->__resp->data;
     $this->response = json_decode($this->responseText, 1);
     $this->__obj = json_decode($this->responseText);
     if (gettype($this->__obj) === 'object') {
         foreach ($this->__obj as $k => $v) {
             $this->{$k} = $v;
         }
     }
     return $this->{$name};
 }
Example #2
0
 public function __get($name)
 {
     if ($this->__resp->code != 200) {
         EpiOAuthException::raise($this->__resp, $this->debug);
     }
     parse_str($this->__resp->data, $result);
     foreach ($result as $k => $v) {
         $this->{$k} = $v;
     }
     return isset($result[$name]) ? $result[$name] : null;
 }
Example #3
0
 public function __get($name)
 {
     if ($this->__resp->code != 200 && $name !== 'responseText') {
         switch ($this->__auth) {
             case EpiTwitter::EPITWITTER_AUTH_OAUTH:
                 EpiOAuthException::raise($this->__resp->data, $this->__resp->code);
             case EpiTwitter::EPITWITTER_AUTH_BASIC:
                 throw new EpiTwitterException($this->__resp->data, $this->__resp->code);
             default:
                 throw new Exception("Unknown EpiTwitter Exception.  Response: {$this->__resp->data}", $this->__resp->code);
         }
     }
     $this->responseText = $this->__resp->data;
     $this->code = $this->__resp->code;
     $this->response = json_decode($this->responseText, 1);
     $this->__obj = json_decode($this->responseText);
     if (gettype($this->__obj) === 'object') {
         foreach ($this->__obj as $k => $v) {
             $this->{$k} = $v;
         }
     }
     return $this->{$name};
 }