original_string: public function addFolder($folder, $extension): ConfigCollection {
          $extLen = strlen($extension);
          $files = scandir($folder, SCANDIR_SORT_ASCENDING);
          foreach ($files as $file) {
              if (in_array($file, ['.','..'])) {
                  continue;
              }
              if (substr($file, -$extLen) != $extension) {
                  continue;
              }
              $config = FileConfig::load(paths($folder, $file), false);
              if ($config) {
                  $this->addConfig($config);
              }
          }
          return $this;
      }
code: public function addFolder($folder, $extension): ConfigCollection {
          $extLen = strlen($extension);
          $files = scandir($folder, SCANDIR_SORT_ASCENDING);
          foreach ($files as $file) {
              if (in_array($file, ['.','..'])) {
                  continue;
              }
              if (substr($file, -$extLen) != $extension) {
                  continue;
              }
              $config = FileConfig::load(paths($folder, $file), false);
              if ($config) {
                  $this->addConfig($config);
              }
          }
          return $this;
      }
code_tokens: public function addFolder ( $ folder , $ extension ) : ConfigCollection { $ extLen = strlen ( $ extension ) ; $ files = scandir ( $ folder , SCANDIR_SORT_ASCENDING ) ; foreach ( $ files as $ file ) { if ( in_array ( $ file , [ '.' , '..' ] ) ) { continue ; } if ( substr ( $ file , - $ extLen ) != $ extension ) { continue ; } $ config = FileConfig :: load ( paths ( $ folder , $ file ) , false ) ; if ( $ config ) { $ this -> addConfig ( $ config ) ; } } return $ this ; }
docstring: Add a folder of config files
  
  @param string $folder
  @param string $extension
  @return ConfigCollection
docstring_tokens: Add a folder of config files