original_string: protected function createREST($first, $last = null, $api_url = self::API_URL)
      {
          if ($first instanceof OAuthToken) {
              $rest = new REST(array(
                  'server' => $api_url,
                  'debug_mode' => $this->debug_mode
              ));
              $auth = $first->getTokenType() . ' ' . $first->getAccessToken();
              $rest->setHeader('Authorization', $auth);
  
              return $rest;
          }
  
          return new REST(array(
              'server' => $api_url,
              'user'   => $first,
              'pass'   => $last,
              'debug_mode' => $this->debug_mode
          ));
      }
code: protected function createREST($first, $last = null, $api_url = self::API_URL)
      {
          if ($first instanceof OAuthToken) {
              $rest = new REST(array(
                  'server' => $api_url,
                  'debug_mode' => $this->debug_mode
              ));
              $auth = $first->getTokenType() . ' ' . $first->getAccessToken();
              $rest->setHeader('Authorization', $auth);
  
              return $rest;
          }
  
          return new REST(array(
              'server' => $api_url,
              'user'   => $first,
              'pass'   => $last,
              'debug_mode' => $this->debug_mode
          ));
      }
code_tokens: protected function createREST ( $ first , $ last = null , $ api_url = self :: API_URL ) { if ( $ first instanceof OAuthToken ) { $ rest = new REST ( array ( 'server' => $ api_url , 'debug_mode' => $ this -> debug_mode ) ) ; $ auth = $ first -> getTokenType ( ) . ' ' . $ first -> getAccessToken ( ) ; $ rest -> setHeader ( 'Authorization' , $ auth ) ; return $ rest ; } return new REST ( array ( 'server' => $ api_url , 'user' => $ first , 'pass' => $ last , 'debug_mode' => $ this -> debug_mode ) ) ; }
docstring: Creates REST object
  
  @param  mixed $first email address or apikey or OAuthToken
  @param  string $last Null if using apikey or OAuthToken
  @return REST
  @ignore
docstring_tokens: Creates REST object