<commit_before><?php namespace Asink\Component;

/**
 * asink-php v0.0.1-dev
 *
 *
 * (c) Ground Six
 *
 * @package asink-php
 * @version 0.0.1-dev
 *
 * @author <NAME> <http://github.com/hazbo>
 *
 * Supported for Asink v0.1.1
 *
 * License: MIT
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

class Client
{
    private
        $tasks,
        $baseUrl,
        $guzzleClient,
        $requestBody;

    /**
     * Creates instance of Guzzle and defines default
     * host and port. Tasks is created as an empty
     * array
     */
    public function __construct()
    {
        $this->baseUrl      = "http://localhost:3000";
        $this->tasks        = array("tasks" => array());
        $this->guzzleClient = new \GuzzleHttp\Client();
    }

    /**
     * The base URL can be overridden at this point
     * if it needs to be changed, port included, for
     * now
     * 
     * @param string $base_url The base URL
     */
    public function setBaseUrl($base_url)
    {
        $this->baseUrl = $base_url;
    }

    /**
     * Adds a new task to the stack
     * 
     * @param string $name The name of the new task
     * @param array  $task Task and command settings
     */
    public function addTask($name, $task = array())
    {
        if (isset($task['command'])) {
            $this->tasks['tasks'][$name] = $task;
        }
    }

    /**
     * Prepares the tasks for request
     */
    private function prepareRequest()
    {
        $this->requestBody = json_encode($this->tasks);
    }

    /**
     * Sends request to Asink server
     */
    public function start()
    {
        $this->prepareRequest();
        $result = $this->guzzleClient->post(
            $this->baseUrl,
            array(
                'headers' => ['Content-type' => 'application/json'],
                'body'    => $this->requestBody
            )
        );
    }
}<commit_msg>Future = true<commit_after><?php namespace Asink\Component;

/**
 * asink-php v0.0.1-dev
 *
 *
 * (c) Ground Six
 *
 * @package asink-php
 * @version 0.0.1-dev
 *
 * @author <NAME> <http://github.com/hazbo>
 *
 * Supported for Asink v0.1.1
 *
 * License: MIT
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

class Client
{
    private
        $tasks,
        $baseUrl,
        $guzzleClient,
        $requestBody;

    /**
     * Creates instance of Guzzle and defines default
     * host and port. Tasks is created as an empty
     * array
     */
    public function __construct()
    {
        $this->baseUrl      = "http://localhost:3000";
        $this->tasks        = array("tasks" => array());
        $this->guzzleClient = new \GuzzleHttp\Client();
    }

    /**
     * The base URL can be overridden at this point
     * if it needs to be changed, port included, for
     * now
     * 
     * @param string $base_url The base URL
     */
    public function setBaseUrl($base_url)
    {
        $this->baseUrl = $base_url;
    }

    /**
     * Adds a new task to the stack
     * 
     * @param string $name The name of the new task
     * @param array  $task Task and command settings
     */
    public function addTask($name, $task = array())
    {
        if (isset($task['command'])) {
            $this->tasks['tasks'][$name] = $task;
        }
    }

    /**
     * Prepares the tasks for request
     */
    private function prepareRequest()
    {
        $this->requestBody = json_encode($this->tasks);
    }

    /**
     * Sends request to Asink server
     */
    public function start()
    {
        $this->prepareRequest();
        $result = $this->guzzleClient->post(
            $this->baseUrl,
            array(
                'headers' => ['Content-type' => 'application/json'],
                'body'    => $this->requestBody,
                'future'  => true
            )
        );
    }
}
{'fraction_non_alphanumeric': 0.13042387760220717, 'fraction_numerical': 0.0065211938801103585, 'mean_word_length': 1.82636428065202, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 40, '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': '1147499', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1188, 'n_words': 333}