protected function mergePath(string $path): string
    {
        $base_path = $this->base_uri->getPath();
        if ('' !== $this->base_uri->getAuthority() && '' === $base_path) {
            return (string) $this->filterPath($path)->withLeadingSlash();
        }

        if ('' !== $base_path) {
            $segments = explode('/', $base_path);
            array_pop($segments);
            $path = implode('/', $segments).'/'.$path;
        }

        return $path;
    }
protected function mergePath(string $path): string
    {
        $base_path = $this->base_uri->getPath();
        if ('' !== $this->base_uri->getAuthority() && '' === $base_path) {
            return (string) $this->filterPath($path)->withLeadingSlash();
        }

        if ('' !== $base_path) {
            $segments = explode('/', $base_path);
            array_pop($segments);
            $path = implode('/', $segments).'/'.$path;
        }

        return $path;
    }
protected function mergePath ( string $ path ) : string { $ base_path = $ this -> base_uri -> getPath ( ) ; if ( '' !== $ this -> base_uri -> getAuthority ( ) && '' === $ base_path ) { return ( string ) $ this -> filterPath ( $ path ) -> withLeadingSlash ( ) ; } if ( '' !== $ base_path ) { $ segments = explode ( '/' , $ base_path ) ; array_pop ( $ segments ) ; $ path = implode ( '/' , $ segments ) . '/' . $ path ; } return $ path ; }
Merging Relative URI path with Base URI path

@param string $path

@return string
Merging Relative URI path with Base URI path