protected function cleanPartsPath(): array
    {
        $parts = [];
        foreach ($this->getPathInfo()
                      ->getDirList() as $part) {
            if ('.' === $part) {
                continue;
            }
            if ('..' === $part) {
                /*
                 * Though path may still be valid in the file system in the
                 * case of relative paths here there is no way to validate
                 * them without accessing the file system to do so. These are
                 * unusual paths probably cause by errors or to access
                 * something unexpected anyway.
                 */
                if (\count($parts) < 1) {
                    $mess = 'Unusual above root path found';
                    throw new \DomainException($mess);
                }
                \array_pop($parts);
                continue;
            }
            $parts[] = $part;
        }
        return $parts;
    }
protected function cleanPartsPath(): array
    {
        $parts = [];
        foreach ($this->getPathInfo()
                      ->getDirList() as $part) {
            if ('.' === $part) {
                continue;
            }
            if ('..' === $part) {
                /*
                 * Though path may still be valid in the file system in the
                 * case of relative paths here there is no way to validate
                 * them without accessing the file system to do so. These are
                 * unusual paths probably cause by errors or to access
                 * something unexpected anyway.
                 */
                if (\count($parts) < 1) {
                    $mess = 'Unusual above root path found';
                    throw new \DomainException($mess);
                }
                \array_pop($parts);
                continue;
            }
            $parts[] = $part;
        }
        return $parts;
    }
protected function cleanPartsPath ( ) : array { $ parts = [ ] ; foreach ( $ this -> getPathInfo ( ) -> getDirList ( ) as $ part ) { if ( '.' === $ part ) { continue ; } if ( '..' === $ part ) { /*
                 * Though path may still be valid in the file system in the
                 * case of relative paths here there is no way to validate
                 * them without accessing the file system to do so. These are
                 * unusual paths probably cause by errors or to access
                 * something unexpected anyway.
                 */ if ( \ count ( $ parts ) < 1 ) { $ mess = 'Unusual above root path found' ; throw new \ DomainException ( $ mess ) ; } \ array_pop ( $ parts ) ; continue ; } $ parts [ ] = $ part ; } return $ parts ; }
Cleans up the actual path part of the given string.

@return string[]
@throws \DomainException
@since 0.1.0-dev The heart of the project.
Cleans up the actual path part of the given string .