gear/Network/Response.php
/**
     * Sets the HTTP status of the response.
     *
     * @param int $code HTTP status code.
     *
     * @return object Self reference
     * @throws \InvalidArgumentException If invalid status code
     */
Sets the HTTP status of the response.
@param int $code HTTP status code.

@return object Self reference
@throws \InvalidArgumentException If invalid status code
Sets the HTTP status of the response . @param int $code HTTP status code . @return object Self reference @throws \ InvalidArgumentException If invalid status code
public function status($code = null)
    {
        if ($code === null) {
            return $this;
        }
        if (array_key_exists($code, self::$codes)) {
            $this->status = $code;
        } else {
            throw new InvalidArgumentException('Invalid status code.');
        }
        return $this;
    }
public function status ( $ code = null ) { if ( $ code === null ) { return $ this ; } if ( array_key_exists ( $ code , self :: $ codes ) ) { $ this -> status = $ code ; } else { throw new InvalidArgumentException ( 'Invalid status code.' ) ; } return $ this ; }
Sets the HTTP status of the response.
Sets the HTTP status of the response .