- Always use guidelines from the
docs/guidelinesfolder
Path: docs/guidelines/how-to-translate-readme-docs.md
Value: Standardizes documentation translation process and multilingual content management
Key Areas:
- Translation workflow using LLMs for documentation
- Multilanguage README pattern using ISO 639-1 codes (
README-{lang_code}.md) - Quality standards: preserve technical content, ensure natural language flow
- Review process for translated content
- MAPS framework for complex translations
Path: docs/guidelines/how-to-write-console-command.md
Value: Ensures consistent CLI interface design and proper Symfony console integration
Key Areas:
- Command structure: extend
Baseclass, use#[AsCommand]attribute - Required methods:
configure()andexecute() - Type system: always use
Pathvalue object instead of strings for file paths - Interactive patterns: use
$input->isInteractive()for detection - Error handling: proper return codes (
Command::SUCCESS,Command::FAILURE,Command::INVALID) - Best practices: method extraction, confirmation dialogs, file operation patterns
- Available services through DI container (Logger, StyleInterface, etc.)
Path: docs/guidelines/how-to-write-php-code-best-practices.md
Value: Maintains modern PHP code quality and leverages latest language features for better performance and maintainability
Key Areas:
- Modern PHP 8.1+ features: constructor promotion, union types, match expressions, throw expressions
- Code structure: PER-2 standards, single responsibility, final classes by default
- Enumerations: use enums for fixed value sets, CamelCase naming, backed enums for primitives
- Immutability: readonly properties,
withprefix for immutable updates - Type system: precise PHPDoc annotations, generics, non-empty-string types
- Comparison patterns: strict equality (
===), null coalescing (??), avoidempty() - Dependency injection and IoC container patterns
Path: docs/guidelines/how-to-write-tests.md
Value: Ensures comprehensive test coverage with modern PHPUnit practices and proper test isolation
Key Areas:
- Test structure: mirror source structure,
finaltest classes, Arrange-Act-Assert pattern - Module testing: independent test areas with dedicated
Stubdirectories - Naming:
{ClassUnderTest}Test, descriptive method names - Modern PHPUnit: PHP 8.1+ attributes (
#[CoversClass],#[DataProvider]), data providers with generators - Isolation: mock dependencies, use test doubles, reset state between tests
- Critical restrictions: DO NOT mock enums or final classes - use real instances
- Error testing: expectException before Act phase
- Test traits for shared functionality