<commit_before><?php

namespace Octokit\Request;

use Buzz\Client\AbstractClient;
use Buzz\Message\MessageInterface;
use Buzz\Message\RequestInterface;

class FixtureRequest extends AbstractClient
{
    public $fixture;
    
    public function __construct($fixture)
    {
        $this->fixture = $fixture;
    }
    
    /**
     * Populates the supplied response with the response for the supplied request.
     *
     * @param RequestInterface $request  A request object.
     * @param MessageInterface $response A response object.
     * 
     * @return void
     */
    public function send(RequestInterface $request, MessageInterface $response)
    {
        if (!isset($this->fixture['status'])) {
            $this->fixture['status'] = 200;
        }
        
        $header = 'HTTP ' . $this->fixture['status'] . ' null';
        
        $response->addHeader($header);
        
        if (!empty($this->fixture['headers'])) {
            $response->addHeaders($this->fixture['headers']);
        }
        
        $response->setContent($this->fixture['body']);
    }
}
<commit_msg>Made setting body for fixture requests optional<commit_after><?php

namespace Octokit\Request;

use Buzz\Client\AbstractClient;
use Buzz\Message\MessageInterface;
use Buzz\Message\RequestInterface;

class FixtureRequest extends AbstractClient
{
    public $fixture;
    
    public function __construct($fixture)
    {
        $this->fixture = $fixture;
    }
    
    /**
     * Populates the supplied response with the response for the supplied request.
     *
     * @param RequestInterface $request  A request object.
     * @param MessageInterface $response A response object.
     * 
     * @return void
     */
    public function send(RequestInterface $request, MessageInterface $response)
    {
        if (!isset($this->fixture['status'])) {
            $this->fixture['status'] = 200;
        }
        
        $response->addHeader('HTTP ' . $this->fixture['status'] . ' null');
        
        if (!empty($this->fixture['headers'])) {
            $response->addHeaders($this->fixture['headers']);
        }
        
        if (!empty($this->fixture['body'])) {
            $response->setContent($this->fixture['body']);
        }
    }
}

{'fraction_non_alphanumeric': 0.13167259786476868, 'fraction_numerical': 0.0026690391459074734, 'mean_word_length': 2.46, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6423973', 'n_tokens_mistral': 625, 'n_tokens_neox': 611, 'n_words': 134}