add('server_request', '/server-request')->controller([PsrRequestController::class, 'serverRequestAction'])->methods(['GET']) ->add('request', '/request')->controller([PsrRequestController::class, 'requestAction'])->methods(['POST']) ->add('message', '/message')->controller([PsrRequestController::class, 'messageAction'])->methods(['PUT']) ; } protected function configureContainer(ContainerConfigurator $container): void { $container->extension('framework', [ 'router' => ['utf8' => true], 'secret' => 'for your eyes only', 'test' => true, ]); $container->services() ->set('nyholm.psr_factory', Psr17Factory::class) ->alias(ResponseFactoryInterface::class, 'nyholm.psr_factory') ->alias(ServerRequestFactoryInterface::class, 'nyholm.psr_factory') ->alias(StreamFactoryInterface::class, 'nyholm.psr_factory') ->alias(UploadedFileFactoryInterface::class, 'nyholm.psr_factory') ; $container->services() ->defaults()->autowire()->autoconfigure() ->set(HttpFoundationFactoryInterface::class, HttpFoundationFactory::class) ->set(HttpMessageFactoryInterface::class, PsrHttpFactory::class) ->set(PsrResponseListener::class) ->set(PsrServerRequestResolver::class) ; $container->services() ->set('logger', NullLogger::class) ->set(PsrRequestController::class)->public()->autowire() ; } }