src/Filesystem/Util.php
protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories)
    {
        if ($object['type'] === 'dir') {
            $listedDirectories[] = $object['path'];
        }

        if (empty($object['dirname'])) {
            return [$directories, $listedDirectories];
        }

        $parent = $object['dirname'];

        while (!empty($parent) && !\in_array($parent, $directories, true)) {
            $directories[] = $parent;
            $parent = static::dirname($parent);
        }

        if (isset($object['type']) && $object['type'] === 'dir') {
            $listedDirectories[] = $object['path'];

            return [$directories, $listedDirectories];
        }

        return [$directories, $listedDirectories];
    }
protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories)
    {
        if ($object['type'] === 'dir') {
            $listedDirectories[] = $object['path'];
        }

        if (empty($object['dirname'])) {
            return [$directories, $listedDirectories];
        }

        $parent = $object['dirname'];

        while (!empty($parent) && !\in_array($parent, $directories, true)) {
            $directories[] = $parent;
            $parent = static::dirname($parent);
        }

        if (isset($object['type']) && $object['type'] === 'dir') {
            $listedDirectories[] = $object['path'];

            return [$directories, $listedDirectories];
        }

        return [$directories, $listedDirectories];
    }
protected static function emulateObjectDirectories ( array $ object , array $ directories , array $ listedDirectories ) { if ( $ object [ 'type' ] === 'dir' ) { $ listedDirectories [ ] = $ object [ 'path' ] ; } if ( empty ( $ object [ 'dirname' ] ) ) { return [ $ directories , $ listedDirectories ] ; } $ parent = $ object [ 'dirname' ] ; while ( ! empty ( $ parent ) && ! \ in_array ( $ parent , $ directories , true ) ) { $ directories [ ] = $ parent ; $ parent = static :: dirname ( $ parent ) ; } if ( isset ( $ object [ 'type' ] ) && $ object [ 'type' ] === 'dir' ) { $ listedDirectories [ ] = $ object [ 'path' ] ; return [ $ directories , $ listedDirectories ] ; } return [ $ directories , $ listedDirectories ] ; }
Emulate the directories of a single object.

@param array $object
@param array $directories
@param array $listedDirectories

@return array
Emulate the directories of a single object .