original_string: protected function loadFiles($path): array
      {
          $config = [];
  
          if (!is_dir($path)) {
              throw new ConfigException("Configuration directory `$path` not found");
          }
  
          $iterator = new \GlobIterator(
              $path . '/*.php',
              \FilesystemIterator::KEY_AS_FILENAME | \FilesystemIterator::CURRENT_AS_PATHNAME
          );
  
          foreach ($iterator as $name => $file) {
              $name = substr($name, 0, -4);
              $config[$name] = $this->loadFile($file);
          }
          return $config;
      }
code: protected function loadFiles($path): array
      {
          $config = [];
  
          if (!is_dir($path)) {
              throw new ConfigException("Configuration directory `$path` not found");
          }
  
          $iterator = new \GlobIterator(
              $path . '/*.php',
              \FilesystemIterator::KEY_AS_FILENAME | \FilesystemIterator::CURRENT_AS_PATHNAME
          );
  
          foreach ($iterator as $name => $file) {
              $name = substr($name, 0, -4);
              $config[$name] = $this->loadFile($file);
          }
          return $config;
      }
code_tokens: protected function loadFiles ( $ path ) : array { $ config = [ ] ; if ( ! is_dir ( $ path ) ) { throw new ConfigException ( "Configuration directory `$path` not found" ) ; } $ iterator = new \ GlobIterator ( $ path . '/*.php' , \ FilesystemIterator :: KEY_AS_FILENAME | \ FilesystemIterator :: CURRENT_AS_PATHNAME ) ; foreach ( $ iterator as $ name => $ file ) { $ name = substr ( $ name , 0 , - 4 ) ; $ config [ $ name ] = $ this -> loadFile ( $ file ) ; } return $ config ; }
docstring: Load configuration files to array
  
  @param  string $path
  
  @return array
  @throws ConfigException
docstring_tokens: Load configuration files to array