public static function parseNamedParams(ServerRequest $request, array $options = [])
    {
        deprecationWarning(
            'Router::parseNamedParams() is deprecated. ' .
            '2.x backwards compatible named parameter support will be removed in 4.0'
        );
        $options += ['separator' => ':'];
        if (!$request->getParam('pass')) {
            return $request->withParam('named', []);
        }
        $named = [];
        $pass = $request->getParam('pass');
        foreach ((array)$pass as $key => $value) {
            if (strpos($value, $options['separator']) === false) {
                continue;
            }
            unset($pass[$key]);
            list($key, $value) = explode($options['separator'], $value, 2);

            if (preg_match_all('/\[([A-Za-z0-9_-]+)?\]/', $key, $matches, PREG_SET_ORDER)) {
                $matches = array_reverse($matches);
                $parts = explode('[', $key);
                $key = array_shift($parts);
                $arr = $value;
                foreach ($matches as $match) {
                    if (empty($match[1])) {
                        $arr = [$arr];
                    } else {
                        $arr = [
                            $match[1] => $arr
                        ];
                    }
                }
                $value = $arr;
            }
            $named = array_merge_recursive($named, [$key => $value]);
        }

        return $request
            ->withParam('pass', $pass)
            ->withParam('named', $named);
    }