public function registerClient(string $name, array $redirectUris): array
    {
        do {
            $client = Client::createNewClient($name, $redirectUris);
        } while ($this->clientRepository->idExists($client->getId()));

        $secret = $client->generateSecret();
        $client = $this->clientRepository->save($client);

        return [$client, $secret];
    }
public function registerClient(string $name, array $redirectUris): array
    {
        do {
            $client = Client::createNewClient($name, $redirectUris);
        } while ($this->clientRepository->idExists($client->getId()));

        $secret = $client->generateSecret();
        $client = $this->clientRepository->save($client);

        return [$client, $secret];
    }
public function registerClient ( string $ name , array $ redirectUris ) : array { do { $ client = Client :: createNewClient ( $ name , $ redirectUris ) ; } while ( $ this -> clientRepository -> idExists ( $ client -> getId ( ) ) ) ; $ secret = $ client -> generateSecret ( ) ; $ client = $ this -> clientRepository -> save ( $ client ) ; return [ $ client , $ secret ] ; }
Register a new client and generate a strong secret

Please note that the secret must be really kept secret, as it is used for some grant type to
authorize the client. It is returned as a result of this method, as it's already encrypted
in the client object

@param string $name
@param array  $redirectUris
@return array [$client, $secret]
Register a new client and generate a strong secret