protected function solver($ex, $params = [])
    {
        $promise = Promise::doResolve();

        foreach ($this->handlers as $handler)
        {
            $current = $handler;

            $promise = $promise->then(
                function() use($ex, $params, $current) {
                    return Promise::doResolve($current->solve($ex, $params));
                }
            );
        }

        return $promise;
    }
protected function solver($ex, $params = [])
    {
        $promise = Promise::doResolve();

        foreach ($this->handlers as $handler)
        {
            $current = $handler;

            $promise = $promise->then(
                function() use($ex, $params, $current) {
                    return Promise::doResolve($current->solve($ex, $params));
                }
            );
        }

        return $promise;
    }
protected function solver ( $ ex , $ params = [ ] ) { $ promise = Promise :: doResolve ( ) ; foreach ( $ this -> handlers as $ handler ) { $ current = $ handler ; $ promise = $ promise -> then ( function ( ) use ( $ ex , $ params , $ current ) { return Promise :: doResolve ( $ current -> solve ( $ ex , $ params ) ) ; } ) ; } return $ promise ; }
Handler to be called when solver is requested.

@param Error|Exception|string $ex
@param mixed[] $params
@return mixed
@throws RejectionException
Handler to be called when solver is requested .