public function setStatus(int $statusCode): void
    {
        if (!isset($this->statusMessages[$statusCode])) {
            throw new \InvalidArgumentException('Invalid HTTP status code.');
        }
        $this->statusCode = $statusCode;
    }
public function setStatus(int $statusCode): void
    {
        if (!isset($this->statusMessages[$statusCode])) {
            throw new \InvalidArgumentException('Invalid HTTP status code.');
        }
        $this->statusCode = $statusCode;
    }
public function setStatus ( int $ statusCode ) : void { if ( ! isset ( $ this -> statusMessages [ $ statusCode ] ) ) { throw new \ InvalidArgumentException ( 'Invalid HTTP status code.' ) ; } $ this -> statusCode = $ statusCode ; }
Sets HTTP status code.

@param int $statusCode
@return void
@throws \InvalidArgumentException
Sets HTTP status code .