protected function createResult(Route $route, ServerRequestInterface $request, array $matches): Match
    {
        $attributes = $route->getAttributes();

        foreach ($attributes as $index => $attribute) {
            $name = $attribute->getName();

            if (array_key_exists($index, $matches)) {
                $request = $request->withAttribute($name, $matches[$index]);
            }
        }

        return new Match($route, $request);
    }