I would like to access request object outside of the handler.
What I'm trying to achieve, is to have a factory class, which based on the values from the request, will setup some class.
Unfortunately code below (in the factory class) doesn't provide a proper request object.
public function __invoke(ContainerInterface $container, $requestedName, array $options = null, ServerRequestInterface $request): AbstractAttributeValidator
{
/** @var ServerRequestInterface $request */
$request = $container->get(ServerRequestInterface::class);
I don't seen anything in the documentation.
Could you suggest something? Or should I approach the problem in different way?