<commit_before><?php

namespace G4\Gateway;

use G4\Gateway\HttpClient;
use G4\Gateway\HttpMethod;
use G4\Gateway\Params;


class Http
{

    /**
     * @var Options
     */
    private $options;

    /**
     * @var string
     */
    private $uri;

    /**
     * @var string
     */
    private $serviceName;


    public function __construct($uri, Options $options)
    {
        $this->uri     = $uri;
        $this->options = $options;
    }

    public function delete(array $params = null)
    {
        return $this->send(HttpMethod::DELETE, $params);
    }

    public function get(array $params = null)
    {
        return $this->send(HttpMethod::GET, $params);
    }

    public function makeClient()
    {
        return new HttpClient($this->options);
    }

    public function post(array $params = null)
    {
        return $this->send(HttpMethod::POST, $params);
    }

    public function put(array $params = null)
    {
        return $this->send(HttpMethod::PUT, $params);
    }

    public function setServiceName($serviceName)
    {
        $this->serviceName = $serviceName;
    }

    private function send($methodName, $params)
    {
        $client = $this->makeClient();
        $method = new HttpMethod($methodName);
        $url    = new Url($this->uri, $this->serviceName, new Params($params));
<commit_msg>Return self in Http setServiceName()<commit_after><?php

namespace G4\Gateway;

use G4\Gateway\HttpClient;
use G4\Gateway\HttpMethod;
use G4\Gateway\Params;


class Http
{

    /**
     * @var Options
     */
    private $options;

    /**
     * @var string
     */
    private $uri;

    /**
     * @var string
     */
    private $serviceName;


    public function __construct($uri, Options $options)
    {
        $this->uri     = $uri;
        $this->options = $options;
    }

    public function delete(array $params = null)
    {
        return $this->send(HttpMethod::DELETE, $params);
    }

    public function get(array $params = null)
    {
        return $this->send(HttpMethod::GET, $params);
    }

    public function makeClient()
    {
        return new HttpClient($this->options);
    }

    public function post(array $params = null)
    {
        return $this->send(HttpMethod::POST, $params);
    }

    public function put(array $params = null)
    {
        return $this->send(HttpMethod::PUT, $params);
    }

    public function setServiceName($serviceName)
    {
        $this->serviceName = $serviceName;
        return $this;
    }

    private function send($methodName, $params)
    {
        $client = $this->makeClient();
        $method = new HttpMethod($methodName);
        $url    = new Url($this->uri, $this->serviceName, new Params($params));

{'fraction_non_alphanumeric': 0.13661402864487698, 'fraction_numerical': 0.0029379360998898272, 'mean_word_length': 2.293833131801693, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '1915113', 'n_tokens_mistral': 844, 'n_tokens_neox': 827, 'n_words': 186}