public static function parseSegments($path)
    {
        if (empty($path)) {
            throw new ValidationException("Cannot parse empty path");
        }
        $segments = [];
        $index = 0;
        $segments[] = self::parseSegmentFromPath($path, $index);
        while ($index < strlen($path)) {
            self::parseLiteralFromPath('/', $path, $index);
            $segments[] = self::parseSegmentFromPath($path, $index);
        }
        return $segments;
    }
public static function parseSegments($path)
    {
        if (empty($path)) {
            throw new ValidationException("Cannot parse empty path");
        }
        $segments = [];
        $index = 0;
        $segments[] = self::parseSegmentFromPath($path, $index);
        while ($index < strlen($path)) {
            self::parseLiteralFromPath('/', $path, $index);
            $segments[] = self::parseSegmentFromPath($path, $index);
        }
        return $segments;
    }
public static function parseSegments ( $ path ) { if ( empty ( $ path ) ) { throw new ValidationException ( "Cannot parse empty path" ) ; } $ segments = [ ] ; $ index = 0 ; $ segments [ ] = self :: parseSegmentFromPath ( $ path , $ index ) ; while ( $ index < strlen ( $ path ) ) { self :: parseLiteralFromPath ( '/' , $ path , $ index ) ; $ segments [ ] = self :: parseSegmentFromPath ( $ path , $ index ) ; } return $ segments ; }
Parses a path into an array of segments.

@param string $path
@return array
@throws ValidationException
Parses a path into an array of segments .