src/Viserio/Component/Routing/Generator/UrlGenerator.php
protected function replaceRouteParameters(string $path, array &$parameters): string
    {
        $path = $this->replaceNamedParameters($path, $parameters);

        $path = \preg_replace_callback('/\{.*?\}/', static function ($match) use (&$parameters) {
            if (\count($parameters) === 0 && ! (\substr($match[0], -\strlen('?}')) === '?}')) {
                return $match[0];
            }

            return \array_shift($parameters);
        }, $path);

        return \trim(\preg_replace('/\{.*?\?\}/', '', $path), '/');
    }
protected function replaceRouteParameters(string $path, array &$parameters): string
    {
        $path = $this->replaceNamedParameters($path, $parameters);

        $path = \preg_replace_callback('/\{.*?\}/', static function ($match) use (&$parameters) {
            if (\count($parameters) === 0 && ! (\substr($match[0], -\strlen('?}')) === '?}')) {
                return $match[0];
            }

            return \array_shift($parameters);
        }, $path);

        return \trim(\preg_replace('/\{.*?\?\}/', '', $path), '/');
    }
Replace all of the wildcard parameters for a route path.

@param string $path
@param array  $parameters

@return string