src/HttpStatus.php
public static function getReasonMessage(int $code): string
    {
        $code = static::filterStatusCode($code);

        if (! isset(self::$errorPhrases[$code])) {
            throw new OutOfBoundsException(\sprintf('Unknown http status code: `%s`.', $code));
        }

        return self::$errorPhrases[$code];
    }
public static function getReasonMessage(int $code): string
    {
        $code = static::filterStatusCode($code);

        if (! isset(self::$errorPhrases[$code])) {
            throw new OutOfBoundsException(\sprintf('Unknown http status code: `%s`.', $code));
        }

        return self::$errorPhrases[$code];
    }
public static function getReasonMessage ( int $ code ) : string { $ code = static :: filterStatusCode ( $ code ) ; if ( ! isset ( self :: $ errorPhrases [ $ code ] ) ) { throw new OutOfBoundsException ( \ sprintf ( 'Unknown http status code: `%s`.' , $ code ) ) ; } return self :: $ errorPhrases [ $ code ] ; }
Get the message for a given status code.

@param int $code http status code

@throws \Narrowspark\HttpStatus\Exception\InvalidArgumentException If the requested $code is not valid
@throws \Narrowspark\HttpStatus\Exception\OutOfBoundsException     If the requested $code is not found

@return string Returns message for the given status code
Get the message for a given status code .