<commit_before><?php

namespace SubscribePro;

use SubscribePro\Exception\InvalidArgumentException;
use SubscribePro\Exception\BadMethodCallException;
use SubscribePro\Service\ServiceFactoryResolver;
use SubscribePro\Tools\ToolFactory;
use SubscribePro\Utils\StringUtils;

/**
 * @method \SubscribePro\Service\Product\ProductService getProductService()
 * @method \SubscribePro\Service\Customer\CustomerService getCustomerService()
 * @method \SubscribePro\Service\Address\AddressService getAddressService()
 * @method \SubscribePro\Service\Subscription\SubscriptionService getSubscriptionService()
 * @method \SubscribePro\Service\PaymentProfile\PaymentProfileService getPaymentProfileService()
 * @method \SubscribePro\Service\Transaction\TransactionService getTransactionService()
 * @method \SubscribePro\Service\Token\TokenService getTokenService()
 * @method \SubscribePro\Service\Webhook\WebhookService getWebhookService()
 * @method \SubscribePro\Tools\Report getReportTool()
 * @method \SubscribePro\Tools\Config getConfigTool()
 *
 * @codeCoverageIgnore
 */
class Sdk
{
    use StringUtils;
    
    /**
     * The name of the environment variable that contains the client ID
     *
     * @const string
     */
    const CLIENT_ID_ENV_NAME = 'SUBSCRIBEPRO_CLIENT_ID';

    /**
     * The name of the environment variable that contains the client secret
     *
     * @const string
     */
    const CLIENT_SECRET_ENV_NAME = 'SUBSCRIBEPRO_CLIENT_SECRET';

    /**
     * @var \SubscribePro\Service\ServiceFactoryResolver
     */
    protected $serviceFactoryResolver;

    /**
     * @var \SubscribePro\Tools\ToolFactory
     */
    protected $toolFactory;

    /**
     * @var \SubscribePro\Http
     */
    protected $http;

    /**
     * @var array
     */
    protected $services = [];

    /**
     * @var array
     */
    protected $tools = [];

    /**
     * Config options:
     * - client_id
     * - client_secret
     * - base_url
     * - logging_enable
     *   default value false
     * - logging_level
     *   default value @see \Psr\Log\LogLevel::INFO
     * - logging_file_name
     *   default value @see SubscribePro\Http::DEFAULT_LOG_FILE_NAME
     * - logging_line_format
     *   default value  @see SubscribePro\Http::DEFAULT_LOG_LINE_FORMAT
     * - logging_message_format
     *   default value @see SubscribePro\Http::DEFAULT_LOG_MESSAGE_FORMAT
     * - <service_name>
     *   Config options for specified service
     *
     * @param array $config
     * @throws \SubscribePro\Exception\InvalidArgumentException
     */
    public function __construct(array $config = [])
    {
        $config = array_merge([
            'client_id' => getenv(static::CLIENT_ID_ENV_NAME),
            'client_secret' => getenv(static::CLIENT_SECRET_ENV_NAME),
            'base_url' => null,
            'logging_enable' => false,
            'logging_level' => null,
            'logging_file_name' => null,
            'logging_line_format' => null,
            'logging_message_format' => null,
            'api_request_timeout' => 30,<commit_msg>Fixed some phpdoc comments to reflect correct namespace<commit_after><?php

namespace SubscribePro;

use SubscribePro\Exception\InvalidArgumentException;
use SubscribePro\Exception\BadMethodCallException;
use SubscribePro\Service\ServiceFactoryResolver;
use SubscribePro\Tools\ToolFactory;
use SubscribePro\Utils\StringUtils;

/**
 * @method \SubscribePro\Service\Product\ProductService getProductService()
 * @method \SubscribePro\Service\Customer\CustomerService getCustomerService()
 * @method \SubscribePro\Service\Address\AddressService getAddressService()
 * @method \SubscribePro\Service\Subscription\SubscriptionService getSubscriptionService()
 * @method \SubscribePro\Service\PaymentProfile\PaymentProfileService getPaymentProfileService()
 * @method \SubscribePro\Service\Transaction\TransactionService getTransactionService()
 * @method \SubscribePro\Service\Token\TokenService getTokenService()
 * @method \SubscribePro\Service\Webhook\WebhookService getWebhookService()
 * @method \SubscribePro\Tools\Report getReportTool()
 * @method \SubscribePro\Tools\Config getConfigTool()
 *
 * @codeCoverageIgnore
 */
class Sdk
{
    use StringUtils;
    
    /**
     * The name of the environment variable that contains the client ID
     *
     * @const string
     */
    const CLIENT_ID_ENV_NAME = 'SUBSCRIBEPRO_CLIENT_ID';

    /**
     * The name of the environment variable that contains the client secret
     *
     * @const string
     */
    const CLIENT_SECRET_ENV_NAME = 'SUBSCRIBEPRO_CLIENT_SECRET';

    /**
     * @var \SubscribePro\Service\ServiceFactoryResolver
     */
    protected $serviceFactoryResolver;

    /**
     * @var \SubscribePro\Tools\ToolFactory
     */
    protected $toolFactory;

    /**
     * @var \SubscribePro\Http
     */
    protected $http;

    /**
     * @var array
     */
    protected $services = [];

    /**
     * @var array
     */
    protected $tools = [];

    /**
     * Config options:
     * - client_id
     * - client_secret
     * - base_url
     * - logging_enable
     *   default value false
     * - logging_level
     *   default value @see \Psr\Log\LogLevel::INFO
     * - logging_file_name
     *   default value @see \SubscribePro\Http::DEFAULT_LOG_FILE_NAME
     * - logging_line_format
     *   default value  @see \SubscribePro\Http::DEFAULT_LOG_LINE_FORMAT
     * - logging_message_format
     *   default value @see \SubscribePro\Http::DEFAULT_LOG_MESSAGE_FORMAT
     * - <service_name>
     *   Config options for specified service
     *
     * @param array $config
     * @throws \SubscribePro\Exception\InvalidArgumentException
     */
    public function __construct(array $config = [])
    {
        $config = array_merge([
            'client_id' => getenv(static::CLIENT_ID_ENV_NAME),
            'client_secret' => getenv(static::CLIENT_SECRET_ENV_NAME),
            'base_url' => null,
            'logging_enable' => false,
            'logging_level' => null,
            'logging_file_name' => null,
            'logging_line_format' => null,
            'logging_message_format' => null,
            'api_request_timeout' => 30,
{'fraction_non_alphanumeric': 0.10308114211969673, 'fraction_numerical': 0.0006452653653815131, 'mean_word_length': 3.033832140533507, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '5685885', 'n_tokens_mistral': 1787, 'n_tokens_neox': 1742, 'n_words': 334}