commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
MeOAuthHandlerFactory.php
1 <?php
2 
3 declare(strict_types=1);
4 
5 namespace Commercetools\Client;
6 
7 use GuzzleHttp\Client;
8 
10 {
11  public static function ofAuthConfig(MeConfig $authConfig, TokenStorage $tokenStorage): OAuth2Handler
12  {
13  $provider = ProviderFactory::of()->createTokenStorageProvider(
14  $authConfig->getAnonUri(),
15  $authConfig->getRefreshUri(),
16  $authConfig->getCredentials(),
17  new Client($authConfig->getOptions()),
18  $tokenStorage
19  );
20 
21  return new OAuth2Handler($provider);
22  }
23 }
static ofAuthConfig(MeConfig $authConfig, TokenStorage $tokenStorage)