public function __invoke(Request
$request): Response
{ $p =
$request->attributes->
get('_route_params',
[]);
if (\
array_key_exists('route',
$p)) { if (\
array_key_exists('path',
$p)) { throw new \
RuntimeException(sprintf('Ambiguous redirection settings, use the "path" or "route" parameter, not both: "%s" and "%s" found respectively in "%s" routing configuration.',
$p['path'
],
$p['route'
],
$request->attributes->
get('_route'
)));
} return $this->
redirectAction($request,
$p['route'
],
$p['permanent'
] ?? false,
$p['ignoreAttributes'
] ?? false,
$p['keepRequestMethod'
] ?? false,
$p['keepQueryParams'
] ?? false
);
} if (\
array_key_exists('path',
$p)) { return $this->
urlRedirectAction($request,
$p['path'
],
$p['permanent'
] ?? false,
$p['scheme'
] ?? null,
$p['httpPort'
] ?? null,
$p['httpsPort'
] ?? null,
$p['keepRequestMethod'
] ?? false
);
} throw new \
RuntimeException(sprintf('The parameter "path" or "route" is required to configure the redirect action in "%s" routing configuration.',
$request->attributes->
get('_route'
)));
}}