/** * @return \Continuous\Sdk\Client */ protected function getClient() { if (is_null($this->client)) { $this->client = Service::factory(['token' => $this->token]); } return $this->client; }
/** * @Given I've instatiated the sdk with the following */ public function iVeInstatiatedTheSdkWithTheFollowing(TableNode $table) { $config = []; foreach ($table->getTable() as $row) { $config[$row[0]] = $row[1]; } $this->sdk = Service::factory($config); }
/** * Task entry point */ public function main() { $config = []; if ($this->token) { $config['token'] = $this->token; } $this->setClient(Service::factory($config)); }
/** * @return Client */ protected function getClient() { // If no client has been set previously, default to a client without an // access token. This is useful for accessing public repositories. if (is_null(self::$client)) { $this->setClient(Service::factory([])); } return self::$client; }
/** * @Given I've instatiated the sdk with the following */ public function iVeInstatiatedTheSdkWithTheFollowing(TableNode $table) { $config = $table->getRowsHash(); $this->sdk = Service::factory($config); }