<commit_before><?php

  require 'src/directoryscanner.php';
  require 'src/filter.php';

  $scanner = new \TheSeer\Tools\DirectoryScanner;
  $scanner->addInclude('*.php');
  $scanner->addExclude('*filter*');
  $scanner->addExclude('./src/*');

  foreach($scanner('.') as $i) {
     var_dump($i);
  }<commit_msg>added non-recursive support, added filter to ensure only files are found, added tests for those, reworked scanner code a little<commit_after><?php

  require 'src/directoryscanner.php';
  require 'src/filesonlyfilter.php';
  require 'src/includeexcludefilter.php';

  $scanner = new \TheSeer\Tools\DirectoryScanner;
  $scanner->addInclude('*.php');
  $scanner->addExclude('*filter*');
  $scanner->addExclude('./src/*');

  foreach($scanner('.') as $i) {
     var_dump($i);
  }
{'fraction_non_alphanumeric': 0.18424396442185514, 'fraction_numerical': 0.0, 'mean_word_length': 4.669064748201439, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1291375', 'n_tokens_mistral': 275, 'n_tokens_neox': 270, 'n_words': 51}