RestClient::__construct PHP Méthode

__construct() public méthode

Decoded response body.
public __construct ( $options = [] )
    public function __construct($options = [])
    {
        $default_options = ['headers' => [], 'parameters' => [], 'curl_options' => [], 'user_agent' => "PHP RestClient/0.1.5", 'base_url' => NULL, 'format' => NULL, 'format_regex' => "/(\\w+)\\/(\\w+)(;[.+])?/", 'decoders' => ['json' => 'json_decode', 'php' => 'unserialize'], 'username' => NULL, 'password' => NULL];
        $this->options = array_merge($default_options, $options);
        if (array_key_exists('decoders', $options)) {
            $this->options['decoders'] = array_merge($default_options['decoders'], $options['decoders']);
        }
    }

Usage Example

Exemple #1
0
 /**
  * Constructor
  */
 public function __construct($token, $baseUrl)
 {
     parent::__construct($token, $baseUrl);
     // API Endpoints
     $this->projects = new Endpoints\Projects($this);
     $this->users = new Endpoints\Users($this);
     $this->milestones = new Endpoints\Milestones($this);
     $this->tasks = new Endpoints\Tasks($this);
     $this->userStories = new Endpoints\UserStories($this);
 }
All Usage Examples Of RestClient::__construct