<commit_before><?php

namespace Krautoload;


class NamespaceInspector_Composer_Basic extends ClassLoader_Composer_Basic implements NamespaceInspector_Composer_Interface {

  /**
   * @inheritdoc
   */
  public function apiVisitClassFiles(InjectedAPI_ClassFileVisitor_Interface $api, array $namespaces, $recursive) {
    foreach ($namespaces as $namespace) {
      $namespace = trim($namespace, '\\');
      $namespace = strlen($namespace) ? $namespace . '\\' : '';
      $this->apiScanNamespace($api, $namespace, $recursive);
    }
  }

  protected function apiScanNamespace(InjectedAPI_ClassFileVisitor_Interface $api, $namespace, $recursive) {
    $api->setNamespace($namespace);
    $namespacePath = str_replace('\\', DIRECTORY_SEPARATOR, $namespace);
    if ($namespaceLength = strlen($namespace)) {
      // Not the base namespace
      $predictor = $namespace[0];
      if (isset($this->prefixes[$predictor])) {
        foreach ($this->prefixes[$predictor] as $prefix => $baseDirs) {
          if (0 === strpos($namespace, $prefix)) {
            $this->apiScanForward($api, $baseDirs, $namespacePath, $recursive);
          }
          elseif ($recursive && 0 === strpos($prefix, $namespace)) {
            $relativePrefix = substr($prefix, $namespaceLength);
            $prefixPath = str_replace('\\', DIRECTORY_SEPARATOR, $prefix);
            $this->apiScanBackwardRecursive($api, $baseDirs, $prefixPath, $relativePrefix);
          }
        }
      }
    }
    else {
      // The base namespace!
      if ($recursive) {
        foreach ($this->prefixes as $predictor => $prefixes) {
          foreach ($prefixes as $prefix => $baseDirs) {
            $prefixPath = str_replace('\\', DIRECTORY_SEPARATOR, $prefix);
            $this->apiScanBackwardRecursive($api, $baseDirs, $prefixPath, $prefix);
          }
        }
      }
    }
    $this->apiScanForward($api, $this->fallbackDirs, $namespace, $recursive);<commit_msg>Remove unused variable in foreach() in NamespaceInspector_Composer_Basic<commit_after><?php

namespace Krautoload;


class NamespaceInspector_Composer_Basic extends ClassLoader_Composer_Basic implements NamespaceInspector_Composer_Interface {

  /**
   * @inheritdoc
   */
  public function apiVisitClassFiles(InjectedAPI_ClassFileVisitor_Interface $api, array $namespaces, $recursive) {
    foreach ($namespaces as $namespace) {
      $namespace = trim($namespace, '\\');
      $namespace = strlen($namespace) ? $namespace . '\\' : '';
      $this->apiScanNamespace($api, $namespace, $recursive);
    }
  }

  protected function apiScanNamespace(InjectedAPI_ClassFileVisitor_Interface $api, $namespace, $recursive) {
    $api->setNamespace($namespace);
    $namespacePath = str_replace('\\', DIRECTORY_SEPARATOR, $namespace);
    if ($namespaceLength = strlen($namespace)) {
      // Not the base namespace
      $predictor = $namespace[0];
      if (isset($this->prefixes[$predictor])) {
        foreach ($this->prefixes[$predictor] as $prefix => $baseDirs) {
          if (0 === strpos($namespace, $prefix)) {
            $this->apiScanForward($api, $baseDirs, $namespacePath, $recursive);
          }
          elseif ($recursive && 0 === strpos($prefix, $namespace)) {
            $relativePrefix = substr($prefix, $namespaceLength);
            $prefixPath = str_replace('\\', DIRECTORY_SEPARATOR, $prefix);
            $this->apiScanBackwardRecursive($api, $baseDirs, $prefixPath, $relativePrefix);
          }
        }
      }
    }
    else {
      // The base namespace!
      if ($recursive) {
        foreach ($this->prefixes as $prefixes) {
          foreach ($prefixes as $prefix => $baseDirs) {
            $prefixPath = str_replace('\\', DIRECTORY_SEPARATOR, $prefix);
            $this->apiScanBackwardRecursive($api, $baseDirs, $prefixPath, $prefix);
          }
        }
      }
    }
    $this->apiScanForward($api, $this->fallbackDirs, $namespace, $recursive);
{'fraction_non_alphanumeric': 0.14256567202244325, 'fraction_numerical': 0.001530221882172915, 'mean_word_length': 3.2217438105489773, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, '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': '3396603', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1133, 'n_words': 220}