<commit_before><?php

namespace BitWasp\Bitcoin\Rpc;

use BitWasp\Bitcoin\JsonRpc\JsonRpcClient;
use BitWasp\Bitcoin\Rpc\Client\Bitcoind;

class RpcFactory
{
    /**
     * @param $host
     * @param $port
     * @param $user
     * @param $password
     * @param int $timeout
     * @param array $headers
     * @return Bitcoind
     */
    public static function bitcoind($host, $port, $user, $password, $timeout = 5, $headers = array())
    {
        $jsonRPCclient = new JsonRpcClient($host, $port, $timeout, $headers);

        if (!is_null($user) && !is_null($password)) {
            $jsonRPCclient->authentication($user, $password);
        }

        $bitcoind = new Bitcoind($jsonRPCclient);

        return $bitcoind;
    }
}
<commit_msg>Tidy RpcFactory::bitcoind as user/pass will always be supplied<commit_after><?php

namespace BitWasp\Bitcoin\Rpc;

use BitWasp\Bitcoin\JsonRpc\JsonRpcClient;
use BitWasp\Bitcoin\Rpc\Client\Bitcoind;

class RpcFactory
{
    /**
     * @param $host
     * @param $port
     * @param $user
     * @param $password
     * @param int $timeout
     * @param array $headers
     * @return Bitcoind
     */
    public static function bitcoind($host, $port, $user, $password, $timeout = 5, $headers = array())
    {
        $jsonRPCclient = new JsonRpcClient($host, $port, $timeout, $headers);
        $jsonRPCclient->authentication($user, $password);

        return new Bitcoind($jsonRPCclient);
    }
}

{'fraction_non_alphanumeric': 0.13623789764868602, 'fraction_numerical': 0.0013831258644536654, 'mean_word_length': 2.953551912568306, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2812791', 'n_tokens_mistral': 487, 'n_tokens_neox': 482, 'n_words': 106}