private function fillPathParams($uri, array &$paramValues)
    {
        return preg_replace_callback('/{(\S+)}/U', function ($matches) use (&$paramValues) {
            $path = $matches[1];
            if (array_key_exists($path, $paramValues)) {
                $value = $paramValues[$path];
                unset($paramValues[$path]);
            } else {
                $value = $path;
            }
            return $value;
        }, $uri);
    }