* @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:----2Tx6QJHRqxdhu5CcNwgjdYF4eKz1H9/NSUJ0p/JnxXnoBf8iTQoZcMvOf8gG6Y9XVkhabbaDw8sYe8BkyyHpP9ubI8/rZ4Ey98fQbhQbmSd2rXn5X87yQ/kMiOR8Es6UJn2xOosbZkGAGMwRWCKqRTX9y+pHa5BV0uOfKPnqCempBcp/AQnKAmkRIe1E+cHbcvt5QakPriAwoPDluTEOQWSM8l7RehizVzcMHVxO+uiu9/ZeAbbR3Mi1eB0BussO4M846e3fQ0URA/Pnj+fr1IAXJ34EQsI5q98Va1qywU06qWk+2D6R6fyHqRiUY58zQp4ASFanpfbUudImw+L7iwEtRr/oFc9jQwy4okMKcJNBcuFS0wul/LYnMnVdvD3c06RBzL+FUf9a6ryZFy4atoW16V3Bt/Ne3jxXT4AJ4iG3qr00mrkxc1r1O9cuoyuhqbPLBQ44G6hEI1cFofGFZ8pt3H/NSZOxhQRQPXkRePT7V7LofbQIuWnMpgrEYw8G/2lpfOLIqCmpcnvvEG62/PvVL15pIokK9CSwqArK5BPVUupIk/gH/wg5XYMqdL5RVFlQIf2t7IV3zMGpxi+/us6SYAXqCFAuTtG4gOerZqpiCVgCMAn8IMjvDtSF6oOtMfQ+YAxOsSLDRSICP2X90sB9udVdZvp+UGvwOWAg32E=----ATTACHMENT:----NDU3ODIxNDcxNjk4NzIwMiAzMzA3MjQ2NTEwNzE0NTI0IDc5NDM3NDM1MjY1OTAzODU=