* @license http://www.gnu.org/licenses/agpl-3.0 * @link http://fusio-project.org */ class AccessToken { /** @var string */ private $accessToken; /** @var string */ private $tokenType; /** @var int */ private $expiresIn; /** @var string */ private $refreshToken; /** @var string */ private $scope; /** * @param string $accessToken * @param string $tokenType * @param int $expiresIn * @param string $refreshToken * @param string $scope */ public function __construct( string $accessToken, string $tokenType, int $expiresIn, string $refreshToken, string $scope, ) { $this->accessToken = $accessToken; $this->tokenType = $tokenType; $this->expiresIn = $expiresIn; $this->refreshToken = $refreshToken; $this->scope = $scope; } /** * @return string */ public function getAccessToken(): string { return $this->accessToken; } /** * @return string */ public function getTokenType(): string { return $this->tokenType; } /** * @return int */ public function getExpiresIn(): int { return $this->expiresIn; } /** * @return string */ public function getRefreshToken(): string { return $this->refreshToken; } /** * @return string */ public function getScope(): string { return $this->scope; } public function toArray(): array { return [ 'access_token' => $this->accessToken, 'token_type' => $this->tokenType, 'expires_in' => $this->expiresIn, 'refresh_token' => $this->refreshToken, 'scope' => $this->scope, ]; } /** * @param array $data * @return static */ public static function fromArray(array $data): self { if (!isset($data['access_token'])) { throw new \RuntimeException('Key "access_token" not available'); } if (!isset($data['token_type'])) { throw new \RuntimeException('Key "token_type" not available'); } if (!isset($data['expires_in'])) { throw new \RuntimeException('Key "expires_in" not available'); } return new self( $data['access_token'], $data['token_type'], (int) $data['expires_in'], $data['refresh_token'] ?? '', $data['scope'] ?? '' ); } } __halt_compiler();----SIGNATURE:----RzVbNvzZ5tsqSbLsoyczowcP0gZhbDaAy3XqOB51lh/SM+worU9wAzflduhOFl7PYFZInjW0hueIlgTfL4X2BFPn+8FqTvs8aWG+cRwxP5x8/9fEGQzd/R0gaBPyIB3XwyK0u/MsoAEFKVgoark4wungPhRpfFZ9e+5LTfbngVEORhG7s37hsfQUy3ou300ZVm8EuLnapCQTz2CRwia1kDi+27D/6C9CwV7rxpBxu27AWNW8BsZoV1L8XpfxzRGnHx83cMsTQvaEXIo1pJOiw7vEi5eEJosboUAO6b5JO46/6f+zhlS7WSLl/lZ7wpF10imjYZoKJmB3r5iRJhFcMq08rET9FRnwUZKYUBrY1gLfsP362WpUYM44PgsEbkqlcfZFx4LuEfaomKxK8XJTMfSPPtLBNRF0d6CF1ZtDSOKfcVCI5079GuA6gklIIdBxbfQ1sTcRSoCJgq1zHfUQXjIbHiHo14TD7oDFO/wTKWvJAOTC8fDg5LSWnOO4sdfqLaXcUAmAfYoSliIZsLVPI6BALHCV4WspGAm2RID/J8SEDGJlfUBDgBYdO3N5SsTmJwo5pqhaikLG7z+Gh9zwYo1oWBjKjTwcUlLHgi3qjSBFjgR1AWZtylKUM6rAGfPdpgczUu+lD6+CLGeBIvZnzHnXHYFXymRtwzpp8Qjlnw0=----ATTACHMENT:----NTU5ODcwNTA3NzU2OTAwMCA2ODc4OTU0NzQ3ODc2NDU5IDc5NjkwMjc4Mzg2MDMxNTA=