<commit_before><?php
/**
 * 
 * This file is part of the Aura project for PHP.
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
namespace Aura\Http\Factory;

use Aura\Http\Header\Collection as Headers;
use Aura\Http\Cookie\Collection as Cookies;
use Aura\Http\Request as HttpRequest;
use Aura\Http\Request\Response as RequestResponse;
use Aura\Http\Cookie\Jar as CookieJar;
use Aura\Http\Transport\Multipart;
use Aura\Http\Request\ResponseBuilder;
use Aura\Http\Request\Adapter\Curl;
use Aura\Http\Request\Adapter\Stream;

/**
 * 
 * Create a new Request instance.
 * 
 * @package Aura.Http
 * 
 */
class Request
{
    /**
     *
     * Convenience method for creating a Request object. 
     * 
     * @param string $adapter Use this adapter. Defaults to `auto` if Curl is 
     * installed the Curl adapter is used else the Stream adapter is used.
     * 
     * @param array $options Adapter specific options and defaults. Currently 
     * only used by Curl.
     * 
     * @return Aura\Http\Request
     *
     */
    public function newInstance($adapter = 'auto', array $options = [])
    {
        $headers          = new Headers(new Header);
        $cookiefactory    = new Cookie;
        $cookies          = new Cookies($cookiefactory);
        $response         = new RequestResponse($headers, $cookies);
        $response_builder = new ResponseBuilder($response, new ResponseStack);

        if ('curl' == $adapter ||
            ('auto' == $adapter && extension_loaded('curl'))) {
            
            $adapter   = new Curl($response_builder, $options);
        } else {
            $cookiejar = new CookieJar($cookiefactory);
            $adapter   = new Stream(
                                $response_builder, 
                                new Multipart, 
                                $cookiejar
                            );
        }

        return new HttpRequest($adapter, $headers, $cookies);
    }
}<commit_msg>use the right class<commit_after><?php
/**
 * 
 * This file is part of the Aura project for PHP.
 * 
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * 
 */
namespace Aura\Http\Request;

use Aura\Http\Cookie\Collection as Cookies;
use Aura\Http\Cookie\Factory as CookieFactory;
use Aura\Http\Header\Collection as Headers;
use Aura\Http\Header\Factory as HeaderFactory;
use Aura\Http\Request as Request;

/**
 * 
 * Create a new Request instance.
 * 
 * @package Aura.Http
 * 
 */
class Factory
{
    /**
     *
     * Convenience method for creating a Request object. 
     * 
     * @param array $options Adapter specific options and defaults. Currently 
     * only used by Curl.
     * 
     * @return Aura\Http\Request
     *
     */
    public function newInstance(array $options = [])
    {
        $headers = new Headers(new HeaderFactory);
        $cookies = new Cookies(new CookieFactory);
        return new Request($headers, $cookies, $options);
    }
}

{'fraction_non_alphanumeric': 0.10768709786657636, 'fraction_numerical': 0.0, 'mean_word_length': 2.228415300546448, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '344367', 'n_tokens_mistral': 877, 'n_tokens_neox': 833, 'n_words': 237}