public function getDirList(): array
    {
        if (!$this->hasDirs()) {
            return [];
        }
        $path = \str_replace('\\', '/', \trim($this->dirs));
        // Drop any leading and trailing "/"s.
        $path = \trim($path, '/');
        // Drop pointless consecutive "/"s.
        while (false !== \strpos($path, '//')) {
            $path = \str_replace('//', '/', $path);
        }
        if ('' !== $path) {
            return \explode('/', $path);
        }
        return [];
    }
public function getDirList(): array
    {
        if (!$this->hasDirs()) {
            return [];
        }
        $path = \str_replace('\\', '/', \trim($this->dirs));
        // Drop any leading and trailing "/"s.
        $path = \trim($path, '/');
        // Drop pointless consecutive "/"s.
        while (false !== \strpos($path, '//')) {
            $path = \str_replace('//', '/', $path);
        }
        if ('' !== $path) {
            return \explode('/', $path);
        }
        return [];
    }
public function getDirList ( ) : array { if ( ! $ this -> hasDirs ( ) ) { return [ ] ; } $ path = \ str_replace ( '\\' , '/' , \ trim ( $ this -> dirs ) ) ; // Drop any leading and trailing "/"s. $ path = \ trim ( $ path , '/' ) ; // Drop pointless consecutive "/"s. while ( false !== \ strpos ( $ path , '//' ) ) { $ path = \ str_replace ( '//' , '/' , $ path ) ; } if ( '' !== $ path ) { return \ explode ( '/' , $ path ) ; } return [ ] ; }
Provides a lightly cleaned up array of the directory path parts without wrappers or root.

The light cleaning done is to remove any leading or trailing whitespace chars,
remove any leading or trailing directory separators to prevent empty parts,
next remove any consecutive directory separators to prevent the empty
parts they would create,
and finally explode the path into an array of parts to be returned.

@return array
Provides a lightly cleaned up array of the directory path parts without wrappers or root .