public function reject(Exception $exception)
    {
        if (HttpPromise::PENDING !== $this->state) {
            throw new \RuntimeException('Promise is already resolved');
        }

        $this->state = HttpPromise::REJECTED;
        $this->exception = $exception;
        $this->doReject($exception);
    }
public function reject(Exception $exception)
    {
        if (HttpPromise::PENDING !== $this->state) {
            throw new \RuntimeException('Promise is already resolved');
        }

        $this->state = HttpPromise::REJECTED;
        $this->exception = $exception;
        $this->doReject($exception);
    }
public function reject ( Exception $ exception ) { if ( HttpPromise :: PENDING !== $ this -> state ) { throw new \ RuntimeException ( 'Promise is already resolved' ) ; } $ this -> state = HttpPromise :: REJECTED ; $ this -> exception = $ exception ; $ this -> doReject ( $ exception ) ; }
Reject this promise.

@param Exception $exception

@internal
Reject this promise .