PHP Response Wrapper
I this this class is not a Response. But a bundle of things.

class Response
{


Name its clear. But if it is clear, I suggest you to make this class final.

    private $headers = array();
    private $code = 200;
    private $body = '';
    private $sent = false;


By default a non sent response is 200 and without headers?

    private $log;


Here my first big confusion. Why a response should log something? A Response is just a response.

    public function __construct() {
        $this-&gt;log = Logger::getLogger(get_class($this));
    }


Alt ^_^. I really suggest you to inject a logger. If you like standards, I suggest to inject Psr\Log\LoggerInterface

    public function headers ($headers) { // Add some headers to the headers array
        $this-&gt;headers = array_merge($this-&gt;headers, $headers);
        return $this;
    }


I suggest 'set' prefix. From the api I do not understand if the method is a setter or a getter.

    public function header ($key, $value) { // set a single header in the headers array
        $this-&gt;headers[$key] = $value;
        return $this;
    }


As above: if this is a setter, ... I suggest 'set' prefix.

    public function code ($code) { // Set the status code
        $this-&gt;code = $code;
        return $this;
    }


Instead of comment "set the status code" change the method in `public function setStatusCode()".

    public function status ($code) { // Alternate method for setting the status code
        return $this-&gt;code($code);;
    }


Why?

    public function json($str) { // respond with json, set the body text and set the content-type header
        $this-&gt;header('Content-Type', 'application/json');
        if(is_array($str)) { // handle either raw JSON text, or php arrays


Why dont you use type hinting and create a method that accept array and one that accept text?

            $this-&gt;body = json_encode($str);
        } else {
            $this-&gt;body = $str;
        }
        return $this;
    }

    public function html ($str){ // respond with HTML


A method called toHtml is more appropriate here.

        $this-&gt;header('Content-Type', 'text/html');
        $this-&gt;body = $str;
        return $this;


Fluent interface is ok just for builders. This class should be rename in ResponseBuilder.

    }

    public function form ($str) { // Respond with form data


Why you comment your code instead of make it more readable?

        $this-&gt;header('Content-Type', 'application/x-www-form-urlencoded');
        // TODO: Allow the user to user an array
        $this-&gt;body = $str;
        return $this;
    }

    public function render ($file){ // Render an HTML file from the templates folder
        //TODO: Restrict to templates folder open
        //TODO: Add server-side rendering code
        $this-&gt;body = file_get_contents($file);
        return $this;
    }

    public function sent() { // Check if the request has been sent
        return $this-&gt;sent;
    }


This method return a boolan. Should be named to isSent. And also should have a return type hint like public function isSent() : bool.

    public function send () { // send the request


Comment is useless. $request-&gt;send() speaks very well.

        if($this-&gt;sent()){
            $log-&gt;error('Attempted to call send on a sent response!');
            exit('Attempted to call send on a sent response!');


I prefer Exceptions every time something unexpected happens.

        }

        // Log the request for debugging
        $this-&gt;log-&gt;info($this-&gt;headers);
        $this-&gt;log-&gt;info('HTTP Responce Code: ' . $this-&gt;code);
        $this-&gt;log-&gt;info($this-&gt;body);


Anytime you use a comment to group some lines of code, you should remove the comment and make a private method like $this-&gt;logRequestForDebugging().

        // Set the headers
        foreach($this-&gt;headers as $key =&gt; $value) {
            header($key .': ' . $value);
        }


$this-&gt;setHeaders()

        // Set the status code
        http_response_code($this-&gt;code);


$this-&gt;setResponseStatusCode()

        // Send out the body
        echo $this-&gt;body;


...

        // Set the sent variable
        $this-&gt;sent = true;
    }
}