public static function fromString($path)
    {
        $pathObject = static::factory()->create($path);
        if (!$pathObject instanceof RelativePathInterface) {
            throw new Exception\NonRelativePathException($pathObject);
        }

        return $pathObject;
    }
public static function fromString($path)
    {
        $pathObject = static::factory()->create($path);
        if (!$pathObject instanceof RelativePathInterface) {
            throw new Exception\NonRelativePathException($pathObject);
        }

        return $pathObject;
    }
public static function fromString ( $ path ) { $ pathObject = static :: factory ( ) -> create ( $ path ) ; if ( ! $ pathObject instanceof RelativePathInterface ) { throw new Exception \ NonRelativePathException ( $ pathObject ) ; } return $ pathObject ; }
Creates a new relative path instance from its string representation.

@param string $path The string representation of the relative path.

@return RelativePathInterface              The newly created relative path instance.
@throws Exception\NonRelativePathException If the supplied string represents a non-relative path.
Creates a new relative path instance from its string representation .