| Total Complexity | 6 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class AuthenticateResponse { |
||
| 7 | |||
| 8 | /** |
||
| 9 | * @var string |
||
| 10 | */ |
||
| 11 | private $accessToken; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | private $clientToken; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | private $rawAvailableProfiles; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var array |
||
| 25 | */ |
||
| 26 | private $rawSelectedProfile; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var array |
||
| 30 | */ |
||
| 31 | private $rawUser; |
||
| 32 | |||
| 33 | 3 | public function __construct( |
|
| 34 | string $accessToken, |
||
| 35 | string $clientToken, |
||
| 36 | array $availableProfiles, |
||
| 37 | array $selectedProfile, |
||
| 38 | array $user |
||
| 39 | ) { |
||
| 40 | 3 | $this->accessToken = $accessToken; |
|
| 41 | 3 | $this->clientToken = $clientToken; |
|
| 42 | 3 | $this->rawAvailableProfiles = $availableProfiles; |
|
| 43 | 3 | $this->rawSelectedProfile = $selectedProfile; |
|
| 44 | 3 | $this->rawUser = $user; |
|
| 45 | 3 | } |
|
| 46 | |||
| 47 | 2 | public function getAccessToken(): string { |
|
| 48 | 2 | return $this->accessToken; |
|
| 49 | } |
||
| 50 | |||
| 51 | 2 | public function getClientToken(): string { |
|
| 52 | 2 | return $this->clientToken; |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return ProfileInfo[] |
||
| 57 | */ |
||
| 58 | 1 | public function getAvailableProfiles(): array { |
|
| 59 | 1 | return array_map([ProfileInfo::class, 'createFromResponse'], $this->rawAvailableProfiles); |
|
| 60 | } |
||
| 61 | |||
| 62 | 2 | public function getSelectedProfile(): ProfileInfo { |
|
| 64 | } |
||
| 65 | |||
| 66 | 2 | public function getUser(): AuthenticationResponseUserField { |
|
| 67 | 2 | return new AuthenticationResponseUserField($this->rawUser['id'], $this->rawUser['properties']); |
|
| 68 | } |
||
| 69 | |||
| 71 |