public static function cancel($promise)
    {
        if (!static::isPromise($promise, true)) {
            throw new \InvalidArgumentException(sprintf('The "%s" method must be called with a compatible Promise.', __METHOD__));
        }
        $promise->cancel();
    }