Files
ai-chat/.continue/rules/request-handling-in-controllers.md
2026-06-10 18:22:27 +02:00

10 lines
685 B
Markdown

---
globs: src/UI/**/*.php
description: Defines best practices for handling HTTP requests in Symfony 7.
Ensures strict separation of concerns by transforming raw request data into
immutable DTOs at the boundary of the UI layer, preventing leakage of
infrastructure details into business logic.
alwaysApply: true
---
The Request object must only be used in the UI layer (Controllers). Immediately convert request data into DTOs located in /src/Logic/[FeatureName]/DTO before passing them to UseCases. Use $request->getPayload() for JSON APIs, $request->query/request for forms, and $request->attributes for route parameters. Never pass the Request object to Logic or Data layers.