/** * @param string $host * @param string $token * @param Client $client */ public function __construct($host, $token = null, Client $client = null) { $this->client = $client ?: new Client($host); if ($token) { $this->client->authenticate($token, Client::AUTH_URL_TOKEN); } parent::__construct(); }
/** * @param string $token * @param Client $client */ public function __construct($token = null, Client $client = null) { $this->client = $client ?: new Client(new CachedHttpClient()); if ($token) { $this->client->authenticate($token, null, Client::AUTH_HTTP_PASSWORD); } parent::__construct(); }
/** * @param string $username * @param string $password */ public function __construct($username = null, $password = null, Api $api = null) { $this->api = $api ?: new Api(); if ($username && $password) { $this->api->setCredentials(new Basic($username, $password)); } parent::__construct(); }