getClient() публичный Метод

public getClient ( string $id ) : yii\authclient\ClientInterface
$id string service id.
Результат yii\authclient\ClientInterface auth client instance.
Пример #1
0
 /**
  * Gets first client by default.
  */
 public function getClient($id = null)
 {
     if ($id === null) {
         list($id, $dummy) = each($this->getClients());
     }
     return parent::getClient($id);
 }
 /**
  * @depends testGetProviderById
  */
 public function testCreateProvider()
 {
     $collection = new Collection();
     $clientId = 'testClientId';
     $clientClassName = TestClient::className();
     $clients = [$clientId => ['class' => $clientClassName]];
     $collection->setClients($clients);
     $provider = $collection->getClient($clientId);
     $this->assertTrue(is_object($provider), 'Unable to create client by config!');
     $this->assertTrue(is_a($provider, $clientClassName), 'Client has wrong class name!');
 }