src/Service/MelisCoreModulesService.php
protected function getDir($dir, $excludeSubFolders = [])
    {
        $directories = [];
        if (file_exists($dir)) {
            $excludeDir = array_merge(['.', '..', '.gitignore'], $excludeSubFolders);
            $directory = array_diff(scandir($dir), $excludeDir);

            foreach ($directory as $d) {
                if (is_dir($dir . '/' . $d)) {
                    $directories[] = $d;
                }
            }

        }

        return $directories;
    }
protected function getDir($dir, $excludeSubFolders = [])
    {
        $directories = [];
        if (file_exists($dir)) {
            $excludeDir = array_merge(['.', '..', '.gitignore'], $excludeSubFolders);
            $directory = array_diff(scandir($dir), $excludeDir);

            foreach ($directory as $d) {
                if (is_dir($dir . '/' . $d)) {
                    $directories[] = $d;
                }
            }

        }

        return $directories;
    }
protected function getDir ( $ dir , $ excludeSubFolders = [ ] ) { $ directories = [ ] ; if ( file_exists ( $ dir ) ) { $ excludeDir = array_merge ( [ '.' , '..' , '.gitignore' ] , $ excludeSubFolders ) ; $ directory = array_diff ( scandir ( $ dir ) , $ excludeDir ) ; foreach ( $ directory as $ d ) { if ( is_dir ( $ dir . '/' . $ d ) ) { $ directories [ ] = $ d ; } } } return $ directories ; }
Returns all the sub-folders in the provided path

@param String $dir
@param array $excludeSubFolders

@return array
Returns all the sub - folders in the provided path