<commit_before><?

class GPRequestData extends GPObject {

  private $data;

  public function __construct(array $data) {
    $this->data = $data;
  }

  public function getInt($key) {
    return $this->get($key, 'is_numeric');
  }

  public function getString($key) {
    return $this->get($key, 'is_string');
  }

  public function getExists($key) {
    return isset($this->data[$key]);
  }

  private function get($key, callable $validator) {
    $value = strip_tags(trim(idx($this->data, $key, '')));
    if ($validator($value)) {
      return $value;
    }
    return null;
  }
}<commit_msg>Added array type to request data, sont strip tags<commit_after><?

class GPRequestData extends GPObject {

  private $data;

  public function __construct(array $data) {
    $this->data = $data;
  }

  public function getInt($key) {
    return $this->get($key, 'is_numeric');
  }

  public function getString($key) {
    return $this->get($key, 'is_string');
  }

  public function getArray($key) {
    return $this->get($key, 'is_array');
  }

  public function getExists($key) {
    return array_key_exists($key, $this->data);
  }

  public function get($key, callable $validator = null) {
    $value = idx($this->data, $key);
    if ($validator === null || $validator($value)) {
      return $value;
    }
    return null;
  }
}
{'fraction_non_alphanumeric': 0.16051243406179352, 'fraction_numerical': 0.0, 'mean_word_length': 3.4713804713804715, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '5369405', 'n_tokens_mistral': 441, 'n_tokens_neox': 434, 'n_words': 106}