gchernikov/request-resolver-bundle
gchernikov/request-resolver-bundle adds a clean request-resolution layer to PHP apps, mapping incoming HTTP requests to the right handlers through configurable resolvers. It decouples routing logic from controllers, keeping request handling organized, testable, and easy to maintain.
composer require gchernikov/request-resolver-bundle. There is almost certainly no Flex recipe, so add it manually to config/bundles.php:
GChernikov\RequestResolverBundle\RequestResolverBundle::class => ['all' => true],
src/ directory and tests/ are the real documentation. Look first for:
controller.argument_value_resolver).Request data into a DTO.composer.json Symfony/PHP version constraints — this determines whether it will even boot on your stack.bin/console debug:container --tag=controller.argument_value_resolver that the resolver is registered with a sensible priority.FormRequest combined with route-model binding: the DTO is your validated input object, and the resolver is the container doing the injection. Expect less batteries-included behavior (no automatic 422 JSON response, no authorize() hook) unless the bundle ships it.public function __invoke(#[FromRequest] CreateOrderDto $dto): Response
Let the bundle populate the DTO from query/body/route data instead of manually calling $request->query->all().ValidatorInterface (or rely on the bundle's validation hook if present). Return a consistent error payload from a kernel exception listener rather than per-controller boilerplate.readonly classes or constructor promotion with no setters. This prevents controllers from mutating input and makes the DTO safe to pass into services.ObjectNormalizer/PropertyInfo; otherwise nested construction will silently produce arrays or fail. Test one nested payload early.App\Dto namespace and share them between HTTP controllers and console/message handlers so the same validation rules apply. Convert the DTO to a command/message at the controller boundary.KernelBrowser or Request::create() and assert both the resolved DTO (via a test controller) and the validation failure path. Add a unit test around the resolver if you customize it.ArgumentValueResolverInterface rather than forking the bundle.composer.json, and be prepared to fork. Check the last commit date and open issues.#[MapRequestPayload] and #[MapQueryString] cover most of this ground using the Serializer and Validator. Adopt this bundle only if it demonstrably adds something (e.g., older Symfony support, custom source merging) — otherwise you are taking on maintenance risk for native functionality.application/json, application/x-www-form-urlencoded, empty bodies, and malformed JSON. Many small resolvers assume one content type and throw unhelpful errors on the others.debug:container --tag=controller.argument_value_resolver), confirm the parameter has the required attribute/type, and use the profiler's request/response panel. A dd()-style dump inside the resolver is often faster than guessing.FormRequest lifecycle. Budget time for Symfony's argument resolver and Serializer conventions before judging the bundle's ergonomics.How can I help you explore Laravel packages today?