<commit_before><?php

namespace Comsig\API;

use Comsig\API\RestClient\RestClient;

class API {
  private $token;
  private $api;

  public function __construct($baseUrl, $token) {
    $this->token = $token;

    $this->api = new RestClient([
      'base_url' => $baseUrl . 'rest/v1/',
      'headers' => [ 'Authorization' => 'Bearer ' . $token->access_token ],
    ]);
  }

  public function get($url) {
    $results = $this->api->get($url);
    return json_decode($results->response)->content;
  }
}<commit_msg>added getList to pull out pagination data automatically<commit_after><?php

namespace Comsig\API;

use Comsig\API\RestClient\RestClient;

class API {
  private $token;
  private $api;

  public function __construct($baseUrl, $token) {
    $this->token = $token;

    $this->api = new RestClient([
      'base_url' => $baseUrl . 'rest/v1/',
      'headers' => [ 'Authorization' => 'Bearer ' . $token->access_token ],
    ]);
  }

  public function getList($url) {
    $results = $this->api->get($url);
    return json_decode($results->response)->content;
  }

  public function get($url) {
    $results = $this->api->get($url);
    return json_decode($results->response);
  }
}
{'fraction_non_alphanumeric': 0.17157275021026072, 'fraction_numerical': 0.001682085786375105, 'mean_word_length': 3.473684210526316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 26, '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': '5241735', 'n_tokens_mistral': 401, 'n_tokens_neox': 394, 'n_words': 82}