public function matchParams(array $params)
    {
        $result = [];
        foreach ($this->explodedParams as $name => list($default, $pattern, $patternName)) {
            if (!\array_key_exists($name, $params)) {
                if (\is_null($default)) {
                    return false;
                }
                $currentParam = $default;
            } else {
                $currentParam = $params[$name];
            }

            if (!\is_null($patternName)) {
                $patternObj = $this->patterns[$patternName];

                try {
                    $result[$name] = $patternObj->toUrl($currentParam);
                } catch (PatternException $exception) {
                    return false;
                }
            } else {
                if (\is_object($currentParam) && \method_exists($currentParam, '__toString')) {
                    $currentParam = (string) $currentParam;
                }
                if (!$this->pregMatchMultiType($pattern, $currentParam)) {
                    return false;
                }
                $result[$name] = $currentParam;
            }
        }

        return $result;
    }