コード例 #1
0
 /**
  * @return \Continuous\Sdk\Client
  */
 protected function getClient()
 {
     if (is_null($this->client)) {
         $this->client = Service::factory(['token' => $this->token]);
     }
     return $this->client;
 }
コード例 #2
0
ファイル: SdkContext.php プロジェクト: rwentzeis/sdk
 /**
  * @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);
 }
コード例 #3
0
 /**
  * Task entry point
  */
 public function main()
 {
     $config = [];
     if ($this->token) {
         $config['token'] = $this->token;
     }
     $this->setClient(Service::factory($config));
 }
コード例 #4
0
 /**
  * @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;
 }
コード例 #5
0
ファイル: ServiceTest.php プロジェクト: rwentzeis/sdk
 public function testGetDescriptionUsesTheRightClassname()
 {
     $this->assertInstanceOf(Service::getDescriptionClass(), Service::getDescription());
 }
コード例 #6
0
ファイル: SdkContext.php プロジェクト: continuousphp/sdk
 /**
  * @Given I've instatiated the sdk with the following
  */
 public function iVeInstatiatedTheSdkWithTheFollowing(TableNode $table)
 {
     $config = $table->getRowsHash();
     $this->sdk = Service::factory($config);
 }