public static function doCancel($promiseOrValue = null)
    {
        if (!$promiseOrValue instanceof PromiseInterface)
        {
            return new PromiseCancelled($promiseOrValue);
        }

        return self::doResolve($promiseOrValue)
            ->then(
                function($value) {
                    return new PromiseCancelled($value);
                },
                function($value) {
                    return new PromiseCancelled($value);
                }
            );
    }
public static function doCancel($promiseOrValue = null)
    {
        if (!$promiseOrValue instanceof PromiseInterface)
        {
            return new PromiseCancelled($promiseOrValue);
        }

        return self::doResolve($promiseOrValue)
            ->then(
                function($value) {
                    return new PromiseCancelled($value);
                },
                function($value) {
                    return new PromiseCancelled($value);
                }
            );
    }
public static function doCancel ( $ promiseOrValue = null ) { if ( ! $ promiseOrValue instanceof PromiseInterface ) { return new PromiseCancelled ( $ promiseOrValue ) ; } return self :: doResolve ( $ promiseOrValue ) -> then ( function ( $ value ) { return new PromiseCancelled ( $ value ) ; } , function ( $ value ) { return new PromiseCancelled ( $ value ) ; } ) ; }
Cancel Promise or value.

@param PromiseInterface|mixed $promiseOrValue
@return PromiseInterface
@cancels Error|Exception|string|null
Cancel Promise or value .