788ddcd0b5
- Establish feature-based architecture with clear separation between Logic, Data, and Shared layers - Define directory structure conventions for controllers, entities, DTOs, managers, mappers, models, processors, providers, repositories, and services - Implement Symfony 7.4+ compliance with proper Request handling (UI layer only) - Enforce PHP 8+ attributes usage instead of annotations - Set up proper DTO usage in UseCases with immutable properties - Configure repository pattern with interfaces in Logic layer and implementations in Data layer - Implement strict separation of concerns with UI layer handling Request objects exclusively - Define clear naming conventions (PascalCase for feature names) - Add shared components directory for reusable elements across features - Establish HTTP status code constants usage instead of magic numbers - Configure proper file placement for controllers in UI/Frontend, UI/Api, and UI/CLI subdirectories - Enforce modern PHP practices with explicit return types and strict typing This commit lays the foundation for a maintainable, scalable Symfony 7.4+ application following clean architecture principles and modern coding standards.
10 lines
685 B
Markdown
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. |