src/Request/Http/HttpResponse.php
public function getCode()
    {
        if (is_null($this->code)) {
            $code = 0;
            if (!empty($this->headers)) {
                foreach ($this->headers as $header) {
                    $matches = array();
                    preg_match('|HTTP/\d(\.\d)?\s+(\d+)(\s+.*)?|', $header, $matches);
                    if (isset($matches[2])) {
                        $code = (int)$matches[2];
                    }
                }
            }
            $this->code = $code;
        }
        return $this->code;
    }
public function getCode()
    {
        if (is_null($this->code)) {
            $code = 0;
            if (!empty($this->headers)) {
                foreach ($this->headers as $header) {
                    $matches = array();
                    preg_match('|HTTP/\d(\.\d)?\s+(\d+)(\s+.*)?|', $header, $matches);
                    if (isset($matches[2])) {
                        $code = (int)$matches[2];
                    }
                }
            }
            $this->code = $code;
        }
        return $this->code;
    }
public function getCode ( ) { if ( is_null ( $ this -> code ) ) { $ code = 0 ; if ( ! empty ( $ this -> headers ) ) { foreach ( $ this -> headers as $ header ) { $ matches = array ( ) ; preg_match ( '|HTTP/\d(\.\d)?\s+(\d+)(\s+.*)?|' , $ header , $ matches ) ; if ( isset ( $ matches [ 2 ] ) ) { $ code = ( int ) $ matches [ 2 ] ; } } } $ this -> code = $ code ; } return $ this -> code ; }
Returns the `last` http response code.

@return int the http code or 0 if not set.
Returns the last http response code .