private static function resolve(array $parts, $absolute)
    {
        $resolved = [];

        foreach ($parts as $path) {
            if ($path === '..') {
                self::resolveParent($resolved, $absolute);
            } elseif (self::isValidPath($path)) {
                $resolved[] = $path;
            }
        }

        return $resolved;
    }
private static function resolve(array $parts, $absolute)
    {
        $resolved = [];

        foreach ($parts as $path) {
            if ($path === '..') {
                self::resolveParent($resolved, $absolute);
            } elseif (self::isValidPath($path)) {
                $resolved[] = $path;
            }
        }

        return $resolved;
    }
private static function resolve ( array $ parts , $ absolute ) { $ resolved = [ ] ; foreach ( $ parts as $ path ) { if ( $ path === '..' ) { self :: resolveParent ( $ resolved , $ absolute ) ; } elseif ( self :: isValidPath ( $ path ) ) { $ resolved [ ] = $ path ; } } return $ resolved ; }
Resolves parent directory references and removes redundant entries.
@param string[] $parts List of parts in the the path
@param bool $absolute Whether the path is an absolute path or not
@return string[] Resolved list of parts in the path
Resolves parent directory references and removes redundant entries .