public function process($response)
    {
        if ($this->checkFlags(self::CONNECTED)) {
            return call_user_func($this->processCallback, $this, $response);
        }

        if ($this->checkFlags(self::STREAM_CONTEXT)) {
            return call_user_func($this->streamCallback, $this, $response);
        }

        // TODO: we should handle invalid states in a different manner.
        throw new RuntimeException("Invalid connection state: $this");
    }
public function process($response)
    {
        if ($this->checkFlags(self::CONNECTED)) {
            return call_user_func($this->processCallback, $this, $response);
        }

        if ($this->checkFlags(self::STREAM_CONTEXT)) {
            return call_user_func($this->streamCallback, $this, $response);
        }

        // TODO: we should handle invalid states in a different manner.
        throw new RuntimeException("Invalid connection state: $this");
    }
public function process ( $ response ) { if ( $ this -> checkFlags ( self :: CONNECTED ) ) { return call_user_func ( $ this -> processCallback , $ this , $ response ) ; } if ( $ this -> checkFlags ( self :: STREAM_CONTEXT ) ) { return call_user_func ( $ this -> streamCallback , $ this , $ response ) ; } // TODO: we should handle invalid states in a different manner. throw new RuntimeException ( "Invalid connection state: $this" ) ; }
Processes a response depending on the current state.

@param mixed $response Response returned from the server.

@return mixed
Processes a response depending on the current state .