<commit_before><?php

namespace BitWasp\Bitcoin\Stratum;

use BitWasp\Bitcoin\Stratum\Connector\ConnectorInterface;
use BitWasp\Bitcoin\Stratum\Request\Request;
use BitWasp\Bitcoin\Stratum\Request\RequestFactory;

class StratumClient
{
    /**
     * @var RequestFactory
     */
    private $reqFactory;

    /**
     * @var ConnectorInterface
     */
    private $connector;

    /**
     * @param \BitWasp\Bitcoin\Stratum\Connector\ConnectorInterface $connector
     * @param RequestFactory $reqFactory
     */
    public function __construct(ConnectorInterface $connector, RequestFactory $reqFactory)
    {
        $this->connector = $connector;
        $this->reqFactory = $reqFactory;
    }

    /**
     * @param $method
     * @param array $params
     * @return \React\Promise\Promise
     */
    public function request($method, array $params = [])
    {
        return $this->connector->send($this->reqFactory->create($method, $params))
            ->then(function ($request) {
                return $this->reqFactory->response($request);
            });
    }
}<commit_msg>add newline<commit_after><?php

namespace BitWasp\Bitcoin\Stratum;

use BitWasp\Bitcoin\Stratum\Connector\ConnectorInterface;
use BitWasp\Bitcoin\Stratum\Request\Request;
use BitWasp\Bitcoin\Stratum\Request\RequestFactory;

class StratumClient
{
    /**
     * @var RequestFactory
     */
    private $reqFactory;

    /**
     * @var ConnectorInterface
     */
    private $connector;

    /**
     * @param \BitWasp\Bitcoin\Stratum\Connector\ConnectorInterface $connector
     * @param RequestFactory $reqFactory
     */
    public function __construct(ConnectorInterface $connector, RequestFactory $reqFactory)
    {
        $this->connector = $connector;
        $this->reqFactory = $reqFactory;
    }

    /**
     * @param $method
     * @param array $params
     * @return \React\Promise\Promise
     */
    public function request($method, array $params = [])
    {
        return $this->connector
            ->send($this->reqFactory->create($method, $params))
            ->then(function ($request) {
                return $this->reqFactory->response($request);
            });
    }
}
{'fraction_non_alphanumeric': 0.12838147638697844, 'fraction_numerical': 0.0, 'mean_word_length': 2.642737896494157, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '3180228', 'n_tokens_mistral': 639, 'n_tokens_neox': 641, 'n_words': 110}