<commit_before><?php namespace BulkSmsCenter;

use BulkSmsCenter\Exceptions\ClientException;

class Client
{
    const VERSION = '0.1';

    const ROUTE_DIRECT = 'direct';
    const ROUTE_PREMIUM = 'premium';

    /**
     * @var HttpClient
     */
    protected $httpClient;

    /**
     * @var Message
     */
    protected $message;

    /**
     * @var array
     */
    protected $postData;

    /**
     * @return string
     */
    private function phpVersion()
    {
        if (!defined('PHP_VERSION_ID')) {
            $version = explode('.',PHP_VERSION);
            define('PHP_VERSION_ID',($version[0] * 10000 + $version[1] * 100 + $version[2]));
        }
        return 'PHP/'.PHP_VERSION_ID;
    }

    public function __construct(Auth $auth = null,HttpClient $httpClient = null)
    {
        if ($httpClient !== null) {
            $this->setHttpClient($httpClient);
        }
        if ($auth !== null) {
            $this->getHttpClient()->setAuth($auth);
        }
        $this->getHttpClient()->setUserAgent([
            'BulkSmsCenter/ApiClient/'.static::VERSION,
            $this->phpVersion(),
        ]);
        $this->setMessage(new Message());
    }

    public function getHttpClient()
    {
        return $this->httpClient ?: $this->httpClient = new HttpClient();
    }

    /**
     * @param HttpClient $httpClient
     *
     * @return $this<commit_msg>Use __NAMESPACE__ for user agent<commit_after><?php namespace BulkSmsCenter;

use BulkSmsCenter\Exceptions\ClientException;

class Client
{
    const VERSION = '0.1';

    const ROUTE_DIRECT = 'direct';
    const ROUTE_PREMIUM = 'premium';

    /**
     * @var HttpClient
     */
    protected $httpClient;

    /**
     * @var Message
     */
    protected $message;

    /**
     * @var array
     */
    protected $postData;

    /**
     * @return string
     */
    private function phpVersion()
    {
        if (!defined('PHP_VERSION_ID')) {
            $version = explode('.',PHP_VERSION);
            define('PHP_VERSION_ID',($version[0] * 10000 + $version[1] * 100 + $version[2]));
        }
        return 'PHP/'.PHP_VERSION_ID;
    }

    public function __construct(Auth $auth = null,HttpClient $httpClient = null)
    {
        if ($httpClient !== null) {
            $this->setHttpClient($httpClient);
        }
        if ($auth !== null) {
            $this->getHttpClient()->setAuth($auth);
        }
        $this->getHttpClient()->setUserAgent([
            __NAMESPACE__.'/ApiClient/'.static::VERSION,
            $this->phpVersion(),
        ]);
        $this->setMessage(new Message());
    }

    public function getHttpClient()
    {
        return $this->httpClient ?: $this->httpClient = new HttpClient();
    }

    /**
     * @param HttpClient $httpClient
     *
     * @return $this
{'fraction_non_alphanumeric': 0.14871611982881597, 'fraction_numerical': 0.009272467902995721, 'mean_word_length': 2.0824175824175826, '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': '3193989', 'n_tokens_mistral': 875, 'n_tokens_neox': 844, 'n_words': 157}