<commit_before><?php

/**
 * This file is part of CoverallsKit.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace coverallskit;

use coverallskit\entity\ReportEntity;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;


/**
 * Class CoverallsReportTransfer
 * @package coverallskit
 */
class CoverallsReportTransfer implements ReportTransfer
{

    /**
     * @var \GuzzleHttp\ClientInterface
     */
    protected $client;

    /**
     * @param ClientInterface $client
     */
    public function __construct(ClientInterface $client = null)
    {
        $httpClient = $client;

        if ($httpClient === null) {
            $httpClient = new Client();
        }
        $this->setClient($httpClient);
    }

    /**
     * @param ClientInterface $client
     */
    public function setClient(ClientInterface $client)
    {
        $this->client = $client;
    }

    /**
     * @return ClientInterface
     */
    public function getClient()
    {
        return $this->client;
    }

    /**
     * @param ReportEntity $report
     */
    public function upload(ReportEntity $report)
    {
        $stream = fopen($report->getName(), 'r');

        $client = $this->getClient();
        $client->request(self::HTTP_METHOD, self::ENDPOINT_URL, [
            'multipart' => [
                'name' => self::JSON_FILE_POST_FIELD_NAME,
                'contents' => $stream
            ]
        ]);
    }

}<commit_msg>array...<commit_after><?php

/**
 * This file is part of CoverallsKit.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace coverallskit;

use coverallskit\entity\ReportEntity;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;


/**
 * Class CoverallsReportTransfer
 * @package coverallskit
 */
class CoverallsReportTransfer implements ReportTransfer
{

    /**
     * @var \GuzzleHttp\ClientInterface
     */
    protected $client;

    /**
     * @param ClientInterface $client
     */
    public function __construct(ClientInterface $client = null)
    {
        $httpClient = $client;

        if ($httpClient === null) {
            $httpClient = new Client();
        }
        $this->setClient($httpClient);
    }

    /**
     * @param ClientInterface $client
     */
    public function setClient(ClientInterface $client)
    {
        $this->client = $client;
    }

    /**
     * @return ClientInterface
     */
    public function getClient()
    {
        return $this->client;
    }

    /**
     * @param ReportEntity $report
     */
    public function upload(ReportEntity $report)
    {
        $stream = fopen($report->getName(), 'r');

        $client = $this->getClient();
        $client->request(self::HTTP_METHOD, self::ENDPOINT_URL, [
            'multipart' => [
                [
                    'name' => self::JSON_FILE_POST_FIELD_NAME,
                    'contents' => $stream
                ]
            ]
        ]);
    }

}
{'fraction_non_alphanumeric': 0.1258448664306405, 'fraction_numerical': 0.0, 'mean_word_length': 2.1204819277108435, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, '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': '6415455', 'n_tokens_mistral': 908, 'n_tokens_neox': 878, 'n_words': 204}