protected function findStatusInHeaders($headers)
    {
        if (!isset($headers[0]) || strpos($headers[0], 'HTTP/') !== 0) {
            throw new UnexpectedValueException('Invalid HTTP Headers, missing status line');
        }

        $parts = explode(' ', trim($headers[0]));

        return (int)trim($parts[1]);
    }
protected function findStatusInHeaders($headers)
    {
        if (!isset($headers[0]) || strpos($headers[0], 'HTTP/') !== 0) {
            throw new UnexpectedValueException('Invalid HTTP Headers, missing status line');
        }

        $parts = explode(' ', trim($headers[0]));

        return (int)trim($parts[1]);
    }
protected function findStatusInHeaders ( $ headers ) { if ( ! isset ( $ headers [ 0 ] ) || strpos ( $ headers [ 0 ] , 'HTTP/' ) !== 0 ) { throw new UnexpectedValueException ( 'Invalid HTTP Headers, missing status line' ) ; } $ parts = explode ( ' ' , trim ( $ headers [ 0 ] ) ) ; return ( int ) trim ( $ parts [ 1 ] ) ; }
Tries to find the http status code in its header.

@param $headers

@return int
Tries to find the http status code in its header .