protected function settle(PromiseInterface $promise)
    {
        $handlers = $this->handlers;

        $this->result = $promise;
        $this->handlers = [];

        foreach ($handlers as $handler)
        {
            $handler($promise);
        }

        return $promise;
    }
protected function settle(PromiseInterface $promise)
    {
        $handlers = $this->handlers;

        $this->result = $promise;
        $this->handlers = [];

        foreach ($handlers as $handler)
        {
            $handler($promise);
        }

        return $promise;
    }
protected function settle ( PromiseInterface $ promise ) { $ handlers = $ this -> handlers ; $ this -> result = $ promise ; $ this -> handlers = [ ] ; foreach ( $ handlers as $ handler ) { $ handler ( $ promise ) ; } return $ promise ; }
Settle Promise with another Promise.

@see PromiseInterface::resolve
@see PromiseInterface::reject
@see PromiseInterface::cancel

@param PromiseInterface $promise
@return PromiseInterface
@resolves mixed|null
@rejects Error|Exception|string|null
@cancels Error|Exception|string|null
Settle Promise with another Promise .