public static function listDirectories(string $directory, int $depth = 1): array
    {
        $path = $directory . str_repeat('*/', $depth);

        $files = array();
        foreach (glob($path, GLOB_ONLYDIR) as $filepath) {
            $files[] = $filepath . '/';
        }
        
        return $files;
    }
public static function listDirectories(string $directory, int $depth = 1): array
    {
        $path = $directory . str_repeat('*/', $depth);

        $files = array();
        foreach (glob($path, GLOB_ONLYDIR) as $filepath) {
            $files[] = $filepath . '/';
        }
        
        return $files;
    }
public static function listDirectories ( string $ directory , int $ depth = 1 ) : array { $ path = $ directory . str_repeat ( '*/' , $ depth ) ; $ files = array ( ) ; foreach ( glob ( $ path , GLOB_ONLYDIR ) as $ filepath ) { $ files [ ] = $ filepath . '/' ; } return $ files ; }
List all subdirectories of the specified directory.

@param string $directory
Path to the directory to list the subdirectories for.

@return string[] Subdirectories of the specified directory.
List all subdirectories of the specified directory .