| Total Complexity | 5 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class Credentials implements CredentialsInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | private $accessToken; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | private $apiBaseUrl; |
||
| 18 | |||
| 19 | |||
| 20 | /** |
||
| 21 | * Credentials constructor. |
||
| 22 | * |
||
| 23 | * @param string $accessToken |
||
| 24 | * @param string $apiBaseUrl |
||
| 25 | */ |
||
| 26 | public function __construct( |
||
| 32 | } |
||
| 33 | |||
| 34 | public static function fromAccessToken(string $accessToken): CredentialsInterface |
||
| 35 | { |
||
| 36 | return new self( |
||
| 37 | $accessToken, |
||
| 38 | self::API_BASE_URL |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | public static function fromAccessTokenSandbox(string $accessToken): CredentialsInterface { |
||
| 43 | return new self( |
||
| 44 | $accessToken, |
||
| 45 | self::API_BASE_URL_SANDBOX |
||
| 46 | ); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | public function getAccessToken(): string |
||
| 53 | { |
||
| 54 | return $this->accessToken; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function getApiBaseUrl(): string |
||
| 63 | } |
||
| 64 | } |
||
| 65 |