commercetools-sdk-php-v2  10.3.0
The platform, import-api and ml-api 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;
28 
29  public function __construct(string $clientId, string $clientSecret, string $scope = null)
30  {
31  $this->clientId = $clientId;
32  $this->clientSecret = $clientSecret;
33  $this->scope = $scope;
34  $this->cacheKey = sha1($clientId . (string)$scope);
35  }
36 
37  public function getClientId(): string
38  {
39  return $this->clientId;
40  }
41 
42  public function getScope(): ?string
43  {
44  return $this->scope;
45  }
46 
47  public function getClientSecret(): string
48  {
49  return $this->clientSecret;
50  }
51 
52  public function getCacheKey(): string
53  {
54  return $this->cacheKey;
55  }
56 }
__construct(string $clientId, string $clientSecret, string $scope=null)