| Total Complexity | 6 |
| Total Lines | 82 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait CredentialsAwareTrait |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The account subdomain. |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected $subdomain; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The authentication token. |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $token; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The password to use for authentication. |
||
| 23 | * |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | protected $password = 'X'; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Returns the subdomain registered with this object. |
||
| 30 | * |
||
| 31 | * @return string |
||
| 32 | */ |
||
| 33 | 3 | final public function getSubdomain(): string |
|
| 34 | { |
||
| 35 | 3 | return $this->subdomain; |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Registers the subdomain with this object. |
||
| 40 | * |
||
| 41 | * @param string $subdomain The subdomain. |
||
| 42 | */ |
||
| 43 | 32 | final public function setSubdomain(string $subdomain) |
|
| 44 | { |
||
| 45 | 32 | $this->subdomain = $subdomain; |
|
| 46 | 32 | } |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Returns the token registered with this object. |
||
| 50 | * |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 3 | final public function getToken(): string |
|
| 54 | { |
||
| 55 | 3 | return $this->token; |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Registers the token with this object. |
||
| 60 | * |
||
| 61 | * @param string $token |
||
| 62 | * @return null |
||
| 63 | */ |
||
| 64 | 32 | final public function setToken(string $token) |
|
| 65 | { |
||
| 66 | 32 | $this->token = $token; |
|
| 67 | 32 | } |
|
| 68 | |||
| 69 | /** |
||
| 70 | * Returns the password registered with this object. |
||
| 71 | * |
||
| 72 | * @return string |
||
| 73 | */ |
||
| 74 | 2 | final public function getPassword(): string |
|
| 75 | { |
||
| 76 | 2 | return $this->password; |
|
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * Registers the password with this object. |
||
| 81 | * |
||
| 82 | * @param string $password The password to use for authentication. |
||
| 83 | */ |
||
| 84 | 1 | final public function setPassword(string $password): void |
|
| 87 | 1 | } |
|
| 88 | } |
||
| 89 |