validate(); /** @var MinecraftAccessKey|null $result */ $result = MinecraftAccessKey::findOne($this->accessToken); if ($result === null) { throw new ForbiddenOperationException('Invalid token.'); } if ($result->isExpired()) { throw new ForbiddenOperationException('Token expired.'); } return true; } }