commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ClientCredentials.php
1 <?php
2 
3 declare(strict_types=1);
10 namespace Commercetools\Client;
11 
16 {
18  private $clientId;
19 
21  private $clientSecret;
22 
24  private $scope;
25 
27  private $cacheKey;
41  public function __construct(string $clientId, string $clientSecret, string $scope = null)
42  {
43  $this->clientId = $clientId;
44  $this->clientSecret = $clientSecret;
45  $this->scope = $scope;
46  $this->cacheKey = sha1($clientId . (string)$scope);
47  }
48 
49  public function getClientId(): string
50  {
51  return $this->clientId;
52  }
53 
54  public function getScope(): ?string
55  {
56  return $this->scope;
57  }
58 
59  public function getClientSecret(): string
60  {
61  return $this->clientSecret;
62  }
63 
64  public function getCacheKey(): string
65  {
66  return $this->cacheKey;
67  }
68 }
__construct(string $clientId, string $clientSecret, string $scope=null)