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;
    }
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;
    }
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 ; }
Add a folder of config files

@param string $folder
@param string $extension
@return ConfigCollection
Add a folder of config files