<commit_before><?php

namespace Kuroi\Cluster\Contracts;

abstract class Factory
{
    /**
     * The adapter being constructed by the factory
     */
    protected $adapter;

    /**
     * Initialise the adapter, including injecting an http client
     *
     * @param object $adapter
     * @param object $client
     */
    public function init($adapter, $client)
    {
        // set the server adapter
        $this->adapter = $adapter;

        // for ease of use we can fallback to a default http client
        if (!$client) {
            $client = new \Kuroi\Cluster\HttpClients\GuzzleHttp;<commit_msg>allow for null value (the norm)<commit_after><?php

namespace Kuroi\Cluster\Contracts;

abstract class Factory
{
    /**
     * The adapter being constructed by the factory
     */
    protected $adapter;

    /**
     * Initialise the adapter, including injecting an http client
     *
     * @param object $adapter
     * @param object $client
     */
    public function init($adapter, $client = null)
    {
        // set the server adapter
        $this->adapter = $adapter;

        // for ease of use we can fallback to a default http client
        if (!$client) {
            $client = new \Kuroi\Cluster\HttpClients\GuzzleHttp;
{'fraction_non_alphanumeric': 0.09687750200160128, 'fraction_numerical': 0.0, 'mean_word_length': 2.238341968911917, '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': '5492987', 'n_tokens_mistral': 344, 'n_tokens_neox': 337, 'n_words': 117}