new Alias('tenant', Tenant::class), 'expires' => new Alias('expires', \DateTimeImmutable::class), 'issued_at' => new Alias('issuedAt', \DateTimeImmutable::class), ]; } /** * {@inheritdoc} */ public function populateFromResponse(ResponseInterface $response): self { $this->populateFromArray(Utils::jsonDecode($response)['access']['token']); return $this; } public function getId(): string { return $this->id; } public function hasExpired(): bool { return $this->expires <= new \DateTimeImmutable('now', $this->expires->getTimezone()); } }