public function addByHttpCode(int $code): self
    {
        $serverProtocol = filter_input(
            \INPUT_SERVER,
            'SERVER_PROTOCOL',
            \FILTER_SANITIZE_STRING
        );
        $protocol = !empty($serverProtocol) ? $serverProtocol : 'HTTP/1.1';
        $sHeader   = "{$protocol} {$code} ".self::getHTTPExplanationByCode($code);
        return $this->add($sHeader);
    }
public function addByHttpCode(int $code): self
    {
        $serverProtocol = filter_input(
            \INPUT_SERVER,
            'SERVER_PROTOCOL',
            \FILTER_SANITIZE_STRING
        );
        $protocol = !empty($serverProtocol) ? $serverProtocol : 'HTTP/1.1';
        $sHeader   = "{$protocol} {$code} ".self::getHTTPExplanationByCode($code);
        return $this->add($sHeader);
    }
public function addByHttpCode ( int $ code ) : self { $ serverProtocol = filter_input ( \ INPUT_SERVER , 'SERVER_PROTOCOL' , \ FILTER_SANITIZE_STRING ) ; $ protocol = ! empty ( $ serverProtocol ) ? $ serverProtocol : 'HTTP/1.1' ; $ sHeader = "{$protocol} {$code} " . self :: getHTTPExplanationByCode ( $ code ) ; return $ this -> add ( $ sHeader ) ; }
It adds the header to the stack by HTTP code.
@param integer $code The code.
@return self.
It adds the header to the stack by HTTP code .