add('/server-request', PsrRequestController::class.'::serverRequestAction')->setMethods(['GET']); $routes->add('/request', PsrRequestController::class.'::requestAction')->setMethods(['POST']); $routes->add('/message', PsrRequestController::class.'::messageAction')->setMethods(['PUT']); } protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { $container->loadFromExtension('framework', [ 'secret' => 'for your eyes only', 'test' => true, ]); $container->register('nyholm.psr_factory', Psr17Factory::class); $container->setAlias(ResponseFactoryInterface::class, 'nyholm.psr_factory'); $container->setAlias(ServerRequestFactoryInterface::class, 'nyholm.psr_factory'); $container->setAlias(StreamFactoryInterface::class, 'nyholm.psr_factory'); $container->setAlias(UploadedFileFactoryInterface::class, 'nyholm.psr_factory'); $container->register(HttpFoundationFactoryInterface::class, HttpFoundationFactory::class)->setAutowired(true)->setAutoconfigured(true); $container->register(HttpMessageFactoryInterface::class, PsrHttpFactory::class)->setAutowired(true)->setAutoconfigured(true); $container->register(PsrResponseListener::class)->setAutowired(true)->setAutoconfigured(true); $container->register(PsrServerRequestResolver::class)->setAutowired(true)->setAutoconfigured(true); $container->register('logger', NullLogger::class); $container->register(PsrRequestController::class)->setPublic(true)->setAutowired(true); } }