Lukasoppermann\Httpstatus\Httpstatus::mergeHttpStatus PHP Method

mergeHttpStatus() public method

Add or Update the HTTP Status array.
public mergeHttpStatus ( integer $code, string $text )
$code integer a HTTP status Code
$text string a associated reason phrase
    public function mergeHttpStatus($code, $text)
    {
        $code = $this->filterStatusCode($code);
        $text = $this->filterReasonPhrase($text);
        if ($this->hasReasonPhrase($text) && $this->getStatusCode($text) !== $code) {
            throw new RuntimeException('The submitted reason phrase is already present in the collection');
        }
        $this->httpStatus[$code] = $text;
    }