<?php
use OAT\Library\EnvironmentManagementClient\Repository\OAuth2ClientRepositoryInterface;
use OAT\Library\EnvironmentManagementClient\Grpc\OAuth2ClientRepository;
class MyService {
/** @var OAuth2ClientRepositoryInterface */
private $oAuth2ClientRepository;
public function __construct(OAuth2ClientRepositoryInterface $oAuth2ClientRepository)
{
$this->oAuth2ClientRepository = $oAuth2ClientRepository;
}
public function myMethod(): void
{
//...
$oAuth2Client = $this->oAuth2ClientRepository->find('client-1');
//...
}
}
$myService = new MyService(new OAuth2ClientRepository());
$myService->myMethod();