<commit_before><?php

namespace Zarlach\TwitchApi\API;

use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
use Zarlach\TwitchApi\Exceptions\RequestRequiresAuthenticationException;
use Zarlach\TwitchApi\Exceptions\RequestRequiresClientIdException;

class Api
{
    /**
     * Twitch token.
     *
     * @var token
     */
    protected $token;

    /**
     * Twitch client id.
     *
     * @var clientId
     */
    protected $clientId;

    /**
     * Guzzle is used to make http requests.
     *
     * @var GuzzleClient
     */
    protected $client;

    /**
     * Construction.
     *
     * @param string $token    Twitch OAuth Token
     * @param string $clientId Twitch client id
     */
    public function __construct($token = null, $clientId = null)
    {

        // Set token if given
        if ($token) {
            $this->setToken($token);
        }

        // Set clientId if given else get from config
        if ($clientId) {
            $this->setClientId($clientId);
        } elseif (config('twitch-api.client_id')) {
            $this->setClientId(config('twitch-api.client_id'));
        }

        // GuzzleHttp Client with default parameters.
        $this->client = new Client([
            'base_uri' => 'https://api.twitch.tv/kraken/',
        ]);
    }

    /**
     * Set clientId.
     *
     * @param string $clientId Twitch client id
     */
    public function setClientId($clientId)
    {
        $this->clientId = $clientId;
    }

    /**
     * Get clientId.
     *
     * @param string clientId optional
     *
     * @return string clientId
     */
    public function getClientId($clientId = null)
    {

        // Return given parameter
        if ($clientId) {
            return $clientId;
        }

        // If clientId is null and no clientId has previously been set<commit_msg>Update Api.php<commit_after><?php

namespace Zarlach\TwitchApi\API;

use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
use Zarlach\TwitchApi\Exceptions\RequestRequiresAuthenticationException;
use Zarlach\TwitchApi\Exceptions\RequestRequiresClientIdException;

class Api
{
    /**
     * Twitch token.
     *
     * @var token
     */
    protected $token;

    /**
     * Twitch client id.
     *
     * @var clientId
     */
    protected $clientId;

    /**
     * Guzzle is used to make http requests.
     *
     * @var GuzzleClient
     */
    protected $client;

    /**
     * Construction.
     *
     * @param string $token    Twitch OAuth Token
     * @param string $clientId Twitch client id
     */
    public function __construct($token = null, $clientId = null)
    {

        // Set token if given
        if ($token) {
            $this->setToken($token);
        }

        // Set clientId if given else get from config
        if ($clientId) {
            $this->setClientId($clientId);
        } elseif (config('twitch-api.client_id')) {
            $this->setClientId(config('twitch-api.client_id'));
        }

        // GuzzleHttp Client with default parameters.
        $this->client = new Client([
            'base_uri' => 'https://api.twitch.tv/kraken/',
            'headers'  => array('Accept' => 'application/vnd.twitchtv.v5+json')
        ]);
    }

    /**
     * Set clientId.
     *
     * @param string $clientId Twitch client id
     */
    public function setClientId($clientId)
    {
        $this->clientId = $clientId;
    }

    /**
     * Get clientId.
     *
     * @param string clientId optional
     *
     * @return string clientId
     */
    public function getClientId($clientId = null)
    {

        // Return given parameter
        if ($clientId) {
            return $clientId;
        }

        // If clientId is null and no clientId has previously been set
{'fraction_non_alphanumeric': 0.1154358837643295, 'fraction_numerical': 0.0007997867235403892, 'mean_word_length': 1.8641221374045802, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '2078233', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1120, 'n_words': 265}