src/Filesystem/Util.php
public static function emulateDirectories(array $listing)
    {
        $directories = [];
        $listedDirectories = [];

        foreach ($listing as $object) {
            [$directories, $listedDirectories] = static::emulateObjectDirectories($object, $directories, $listedDirectories);
        }

        $directories = \array_diff(
            \array_unique($directories),
            \array_unique($listedDirectories)
        );

        foreach ($directories as $directory) {
            $listing[] = static::pathinfo($directory) + ['type' => 'dir'];
        }

        return $listing;
    }
public static function emulateDirectories(array $listing)
    {
        $directories = [];
        $listedDirectories = [];

        foreach ($listing as $object) {
            [$directories, $listedDirectories] = static::emulateObjectDirectories($object, $directories, $listedDirectories);
        }

        $directories = \array_diff(
            \array_unique($directories),
            \array_unique($listedDirectories)
        );

        foreach ($directories as $directory) {
            $listing[] = static::pathinfo($directory) + ['type' => 'dir'];
        }

        return $listing;
    }
public static function emulateDirectories ( array $ listing ) { $ directories = [ ] ; $ listedDirectories = [ ] ; foreach ( $ listing as $ object ) { [ $ directories , $ listedDirectories ] = static :: emulateObjectDirectories ( $ object , $ directories , $ listedDirectories ) ; } $ directories = \ array_diff ( \ array_unique ( $ directories ) , \ array_unique ( $ listedDirectories ) ) ; foreach ( $ directories as $ directory ) { $ listing [ ] = static :: pathinfo ( $ directory ) + [ 'type' => 'dir' ] ; } return $ listing ; }
Emulate directories.

@param array $listing

@return array listing with emulated directories
Emulate directories .