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