<commit_before><?php
/**
 * This file is part of the SevenShores/NetSuite library.
 *
 * @package    ryanwinchester/netsuite-php
 * @author     <NAME> <<EMAIL>>
 * @copyright  Copyright (c) <NAME>
 * @license    http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
 * @link       https://github.com/ryanwinchester/netsuite-php
 * created:    2015-01-22  1:04 PM
 */

namespace NetSuite;

use NetSuite\Classes\ApplicationInfo;
use NetSuite\Classes\GetDataCenterUrlsRequest;
use NetSuite\Classes\Passport;
use NetSuite\Classes\Preferences;
use NetSuite\Classes\RecordRef;
use NetSuite\Classes\SearchPreferences;
use NetSuite\Classes\TokenPassport;
use NetSuite\Classes\TokenPassportSignature;
use SoapClient;
use SoapHeader;

class NetSuiteClient
{
    /**
     * @var array
     */
    private $config;
    /**
     * @var SoapClient
     */
    private $client;
    /**
     * @var array
     */
    private $soapHeaders = array();

    /**
     * @param array $config
     * @param array $options
     * @param SoapClient $client
     */
    public function __construct($config = null, $options = [], $client = null)
    {
        $this->config = $config ?? self::getEnvConfig();
        $this->validateConfig($this->config);
        $options = $this->createOptions($this->config, $options);
        $wsdl = $this->createWsdl($this->config);
        $this->client = $client ?: new SoapClient($wsdl, $options);
        if ($config['host'] == 'https://webservices.netsuite.com') {
            // Fetch the data center URL for this account because the user
            // provided the legacy webservices URL.
            $this->setDataCenterUrl($config);
        }
    }

    /**<commit_msg>Refactor php7 null coalesce operator<commit_after><?php
/**
 * This file is part of the SevenShores/NetSuite library.
 *
 * @package    ryanwinchester/netsuite-php
 * @author     <NAME> <<EMAIL>>
 * @copyright  Copyright (c) <NAME>
 * @license    http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
 * @link       https://github.com/ryanwinchester/netsuite-php
 * created:    2015-01-22  1:04 PM
 */

namespace NetSuite;

use NetSuite\Classes\ApplicationInfo;
use NetSuite\Classes\GetDataCenterUrlsRequest;
use NetSuite\Classes\Passport;
use NetSuite\Classes\Preferences;
use NetSuite\Classes\RecordRef;
use NetSuite\Classes\SearchPreferences;
use NetSuite\Classes\TokenPassport;
use NetSuite\Classes\TokenPassportSignature;
use SoapClient;
use SoapHeader;

class NetSuiteClient
{
    /**
     * @var array
     */
    private $config;
    /**
     * @var SoapClient
     */
    private $client;
    /**
     * @var array
     */
    private $soapHeaders = array();

    /**
     * @param array $config
     * @param array $options
     * @param SoapClient $client
     */
    public function __construct($config = null, $options = [], $client = null)
    {
        if ($config) {
            $this->config = $config;
        } else {
            $this->config = self::getEnvConfig();
        }
        $this->validateConfig($this->config);
        $options = $this->createOptions($this->config, $options);
        $wsdl = $this->createWsdl($this->config);
        $this->client = $client ?: new SoapClient($wsdl, $options);
        if ($config['host'] == 'https://webservices.netsuite.com') {
            // Fetch the data center URL for this account because the user
            // provided the legacy webservices URL.
            $this->setDataCenterUrl($config);
        }
    }

    /**
{'fraction_non_alphanumeric': 0.13838644846396783, 'fraction_numerical': 0.008900373241458513, 'mean_word_length': 2.690677966101695, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 30, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '6575694', 'n_tokens_mistral': 1082, 'n_tokens_neox': 1053, 'n_words': 236}