@the-bearded-bear/claude-craft 3.1.2 → 3.3.1-next.f4f0d1e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dev/i18n/de/Angular/CLAUDE.md.template +49 -0
- package/Dev/i18n/de/Angular/agents/angular-reviewer.md +213 -0
- package/Dev/i18n/de/Angular/checklists/new-feature.md +125 -0
- package/Dev/i18n/de/Angular/checklists/pre-commit.md +77 -0
- package/Dev/i18n/de/Angular/commands/check-architecture.md +261 -0
- package/Dev/i18n/de/Angular/commands/check-code-quality.md +238 -0
- package/Dev/i18n/de/Angular/commands/check-compliance.md +199 -0
- package/Dev/i18n/de/Angular/commands/check-security.md +263 -0
- package/Dev/i18n/de/Angular/commands/check-testing.md +292 -0
- package/Dev/i18n/de/Angular/commands/generate-component.md +220 -0
- package/Dev/i18n/de/Angular/rules/00-project-context.md.template +78 -0
- package/Dev/i18n/de/Angular/rules/02-architecture-angular.md +477 -0
- package/Dev/i18n/de/Angular/rules/03-coding-standards.md +640 -0
- package/Dev/i18n/de/Angular/rules/06-tooling.md +516 -0
- package/Dev/i18n/de/Angular/rules/07-testing-angular.md +739 -0
- package/Dev/i18n/de/Angular/rules/08-quality-tools.md +501 -0
- package/Dev/i18n/de/Angular/rules/11-security-angular.md +497 -0
- package/Dev/i18n/de/Angular/templates/component.template.ts +115 -0
- package/Dev/i18n/de/Angular/templates/service.template.ts +203 -0
- package/Dev/i18n/de/CSharp/CLAUDE.md.template +65 -0
- package/Dev/i18n/de/CSharp/agents/csharp-reviewer.md +166 -0
- package/Dev/i18n/de/CSharp/checklists/new-feature.md +178 -0
- package/Dev/i18n/de/CSharp/checklists/pre-commit.md +126 -0
- package/Dev/i18n/de/CSharp/commands/check-architecture.md +294 -0
- package/Dev/i18n/de/CSharp/commands/check-code-quality.md +355 -0
- package/Dev/i18n/de/CSharp/commands/check-compliance.md +178 -0
- package/Dev/i18n/de/CSharp/commands/check-security.md +369 -0
- package/Dev/i18n/de/CSharp/commands/check-testing.md +295 -0
- package/Dev/i18n/de/CSharp/commands/generate-feature.md +481 -0
- package/Dev/i18n/de/CSharp/rules/00-project-context.md.template +100 -0
- package/Dev/i18n/de/CSharp/rules/02-architecture-csharp.md +536 -0
- package/Dev/i18n/de/CSharp/rules/03-coding-standards.md +494 -0
- package/Dev/i18n/de/CSharp/rules/06-tooling.md +493 -0
- package/Dev/i18n/de/CSharp/rules/07-testing-csharp.md +566 -0
- package/Dev/i18n/de/CSharp/rules/08-quality-tools.md +497 -0
- package/Dev/i18n/de/CSharp/rules/11-security-csharp.md +568 -0
- package/Dev/i18n/de/CSharp/rules/12-aspire-cloud-native.md +514 -0
- package/Dev/i18n/de/CSharp/templates/command-handler.template.cs +100 -0
- package/Dev/i18n/de/CSharp/templates/entity.template.cs +159 -0
- package/Dev/i18n/de/Common/commands/add-technology.md +195 -0
- package/Dev/i18n/de/Laravel/CLAUDE.md.template +104 -0
- package/Dev/i18n/de/Laravel/agents/laravel-reviewer.md +200 -0
- package/Dev/i18n/de/Laravel/checklists/new-feature.md +277 -0
- package/Dev/i18n/de/Laravel/checklists/pre-commit.md +156 -0
- package/Dev/i18n/de/Laravel/commands/check-architecture.md +306 -0
- package/Dev/i18n/de/Laravel/commands/check-code-quality.md +302 -0
- package/Dev/i18n/de/Laravel/commands/check-compliance.md +141 -0
- package/Dev/i18n/de/Laravel/commands/check-security.md +372 -0
- package/Dev/i18n/de/Laravel/commands/check-testing.md +397 -0
- package/Dev/i18n/de/Laravel/commands/generate-controller.md +388 -0
- package/Dev/i18n/de/Laravel/rules/00-project-context.md.template +140 -0
- package/Dev/i18n/de/Laravel/rules/02-architecture-laravel.md +644 -0
- package/Dev/i18n/de/Laravel/rules/03-coding-standards.md +573 -0
- package/Dev/i18n/de/Laravel/rules/06-tooling.md +580 -0
- package/Dev/i18n/de/Laravel/rules/07-testing-laravel.md +525 -0
- package/Dev/i18n/de/Laravel/rules/08-quality-tools.md +591 -0
- package/Dev/i18n/de/Laravel/rules/11-security-laravel.md +787 -0
- package/Dev/i18n/de/Laravel/templates/action.template.php +79 -0
- package/Dev/i18n/de/Laravel/templates/controller.template.php +99 -0
- package/Dev/i18n/de/Laravel/templates/model.template.php +206 -0
- package/Dev/i18n/de/Laravel/templates/test.template.php +263 -0
- package/Dev/i18n/de/PHP/CLAUDE.md.template +460 -0
- package/Dev/i18n/de/PHP/agents/php-reviewer.md +345 -0
- package/Dev/i18n/de/PHP/checklists/new-feature.md +132 -0
- package/Dev/i18n/de/PHP/checklists/pre-commit.md +231 -0
- package/Dev/i18n/de/PHP/commands/check-architecture.md +557 -0
- package/Dev/i18n/de/PHP/commands/check-code-quality.md +448 -0
- package/Dev/i18n/de/PHP/commands/check-compliance.md +477 -0
- package/Dev/i18n/de/PHP/commands/check-security.md +420 -0
- package/Dev/i18n/de/PHP/commands/check-testing.md +486 -0
- package/Dev/i18n/de/PHP/rules/00-project-context.md.template +266 -0
- package/Dev/i18n/de/PHP/rules/02-architecture-php.md +696 -0
- package/Dev/i18n/de/PHP/rules/03-coding-standards.md +641 -0
- package/Dev/i18n/de/PHP/rules/06-tooling.md +543 -0
- package/Dev/i18n/de/PHP/rules/07-testing-php.md +636 -0
- package/Dev/i18n/de/PHP/rules/08-quality-tools.md +533 -0
- package/Dev/i18n/de/PHP/rules/11-security-php.md +759 -0
- package/Dev/i18n/de/PHP/templates/entity.md +435 -0
- package/Dev/i18n/de/PHP/templates/use-case.md +512 -0
- package/Dev/i18n/de/PHP/templates/value-object.md +555 -0
- package/Dev/i18n/de/VueJS/CLAUDE.md.template +102 -0
- package/Dev/i18n/de/VueJS/agents/vuejs-reviewer.md +206 -0
- package/Dev/i18n/de/VueJS/checklists/new-feature.md +131 -0
- package/Dev/i18n/de/VueJS/checklists/pre-commit.md +68 -0
- package/Dev/i18n/de/VueJS/commands/check-architecture.md +137 -0
- package/Dev/i18n/de/VueJS/commands/check-code-quality.md +152 -0
- package/Dev/i18n/de/VueJS/commands/check-compliance.md +124 -0
- package/Dev/i18n/de/VueJS/commands/check-security.md +186 -0
- package/Dev/i18n/de/VueJS/commands/check-testing.md +185 -0
- package/Dev/i18n/de/VueJS/commands/generate-component.md +233 -0
- package/Dev/i18n/de/VueJS/rules/00-project-context.md.template +125 -0
- package/Dev/i18n/de/VueJS/rules/02-architecture-vuejs.md +375 -0
- package/Dev/i18n/de/VueJS/rules/03-coding-standards.md +502 -0
- package/Dev/i18n/de/VueJS/rules/06-tooling.md +422 -0
- package/Dev/i18n/de/VueJS/rules/07-testing-vuejs.md +606 -0
- package/Dev/i18n/de/VueJS/rules/08-quality-tools.md +441 -0
- package/Dev/i18n/de/VueJS/rules/11-security-vuejs.md +465 -0
- package/Dev/i18n/de/VueJS/templates/component.template.vue +133 -0
- package/Dev/i18n/de/VueJS/templates/composable.template.ts +162 -0
- package/Dev/i18n/de/VueJS/templates/store.template.ts +282 -0
- package/Dev/i18n/de/VueJS/templates/test.template.ts +233 -0
- package/Dev/i18n/en/Angular/CLAUDE.md.template +49 -0
- package/Dev/i18n/en/Angular/agents/angular-reviewer.md +213 -0
- package/Dev/i18n/en/Angular/checklists/new-feature.md +125 -0
- package/Dev/i18n/en/Angular/checklists/pre-commit.md +77 -0
- package/Dev/i18n/en/Angular/commands/check-architecture.md +261 -0
- package/Dev/i18n/en/Angular/commands/check-code-quality.md +238 -0
- package/Dev/i18n/en/Angular/commands/check-compliance.md +199 -0
- package/Dev/i18n/en/Angular/commands/check-security.md +263 -0
- package/Dev/i18n/en/Angular/commands/check-testing.md +292 -0
- package/Dev/i18n/en/Angular/commands/generate-component.md +220 -0
- package/Dev/i18n/en/Angular/rules/00-project-context.md.template +78 -0
- package/Dev/i18n/en/Angular/rules/02-architecture-angular.md +477 -0
- package/Dev/i18n/en/Angular/rules/03-coding-standards.md +640 -0
- package/Dev/i18n/en/Angular/rules/06-tooling.md +516 -0
- package/Dev/i18n/en/Angular/rules/07-testing-angular.md +739 -0
- package/Dev/i18n/en/Angular/rules/08-quality-tools.md +501 -0
- package/Dev/i18n/en/Angular/rules/11-security-angular.md +497 -0
- package/Dev/i18n/en/Angular/templates/component.template.ts +115 -0
- package/Dev/i18n/en/Angular/templates/service.template.ts +203 -0
- package/Dev/i18n/en/CSharp/CLAUDE.md.template +65 -0
- package/Dev/i18n/en/CSharp/agents/csharp-reviewer.md +166 -0
- package/Dev/i18n/en/CSharp/checklists/new-feature.md +178 -0
- package/Dev/i18n/en/CSharp/checklists/pre-commit.md +126 -0
- package/Dev/i18n/en/CSharp/commands/check-architecture.md +294 -0
- package/Dev/i18n/en/CSharp/commands/check-code-quality.md +355 -0
- package/Dev/i18n/en/CSharp/commands/check-compliance.md +178 -0
- package/Dev/i18n/en/CSharp/commands/check-security.md +369 -0
- package/Dev/i18n/en/CSharp/commands/check-testing.md +295 -0
- package/Dev/i18n/en/CSharp/commands/generate-feature.md +481 -0
- package/Dev/i18n/en/CSharp/rules/00-project-context.md.template +100 -0
- package/Dev/i18n/en/CSharp/rules/02-architecture-csharp.md +536 -0
- package/Dev/i18n/en/CSharp/rules/03-coding-standards.md +494 -0
- package/Dev/i18n/en/CSharp/rules/06-tooling.md +493 -0
- package/Dev/i18n/en/CSharp/rules/07-testing-csharp.md +566 -0
- package/Dev/i18n/en/CSharp/rules/08-quality-tools.md +497 -0
- package/Dev/i18n/en/CSharp/rules/11-security-csharp.md +568 -0
- package/Dev/i18n/en/CSharp/rules/12-aspire-cloud-native.md +514 -0
- package/Dev/i18n/en/CSharp/templates/command-handler.template.cs +100 -0
- package/Dev/i18n/en/CSharp/templates/entity.template.cs +159 -0
- package/Dev/i18n/en/Common/commands/add-technology.md +293 -0
- package/Dev/i18n/en/Laravel/CLAUDE.md.template +104 -0
- package/Dev/i18n/en/Laravel/agents/laravel-reviewer.md +200 -0
- package/Dev/i18n/en/Laravel/checklists/new-feature.md +277 -0
- package/Dev/i18n/en/Laravel/checklists/pre-commit.md +156 -0
- package/Dev/i18n/en/Laravel/commands/check-architecture.md +306 -0
- package/Dev/i18n/en/Laravel/commands/check-code-quality.md +302 -0
- package/Dev/i18n/en/Laravel/commands/check-compliance.md +141 -0
- package/Dev/i18n/en/Laravel/commands/check-security.md +372 -0
- package/Dev/i18n/en/Laravel/commands/check-testing.md +397 -0
- package/Dev/i18n/en/Laravel/commands/generate-controller.md +388 -0
- package/Dev/i18n/en/Laravel/rules/00-project-context.md.template +140 -0
- package/Dev/i18n/en/Laravel/rules/02-architecture-laravel.md +644 -0
- package/Dev/i18n/en/Laravel/rules/03-coding-standards.md +573 -0
- package/Dev/i18n/en/Laravel/rules/06-tooling.md +580 -0
- package/Dev/i18n/en/Laravel/rules/07-testing-laravel.md +525 -0
- package/Dev/i18n/en/Laravel/rules/08-quality-tools.md +591 -0
- package/Dev/i18n/en/Laravel/rules/11-security-laravel.md +787 -0
- package/Dev/i18n/en/Laravel/templates/action.template.php +79 -0
- package/Dev/i18n/en/Laravel/templates/controller.template.php +99 -0
- package/Dev/i18n/en/Laravel/templates/model.template.php +206 -0
- package/Dev/i18n/en/Laravel/templates/test.template.php +263 -0
- package/Dev/i18n/en/PHP/CLAUDE.md.template +460 -0
- package/Dev/i18n/en/PHP/agents/php-reviewer.md +345 -0
- package/Dev/i18n/en/PHP/checklists/new-feature.md +132 -0
- package/Dev/i18n/en/PHP/checklists/pre-commit.md +231 -0
- package/Dev/i18n/en/PHP/commands/check-architecture.md +557 -0
- package/Dev/i18n/en/PHP/commands/check-code-quality.md +448 -0
- package/Dev/i18n/en/PHP/commands/check-compliance.md +477 -0
- package/Dev/i18n/en/PHP/commands/check-security.md +420 -0
- package/Dev/i18n/en/PHP/commands/check-testing.md +486 -0
- package/Dev/i18n/en/PHP/rules/00-project-context.md.template +266 -0
- package/Dev/i18n/en/PHP/rules/02-architecture-php.md +696 -0
- package/Dev/i18n/en/PHP/rules/03-coding-standards.md +641 -0
- package/Dev/i18n/en/PHP/rules/06-tooling.md +543 -0
- package/Dev/i18n/en/PHP/rules/07-testing-php.md +636 -0
- package/Dev/i18n/en/PHP/rules/08-quality-tools.md +533 -0
- package/Dev/i18n/en/PHP/rules/11-security-php.md +759 -0
- package/Dev/i18n/en/PHP/templates/entity.md +435 -0
- package/Dev/i18n/en/PHP/templates/use-case.md +512 -0
- package/Dev/i18n/en/PHP/templates/value-object.md +555 -0
- package/Dev/i18n/en/VueJS/CLAUDE.md.template +102 -0
- package/Dev/i18n/en/VueJS/agents/vuejs-reviewer.md +206 -0
- package/Dev/i18n/en/VueJS/checklists/new-feature.md +131 -0
- package/Dev/i18n/en/VueJS/checklists/pre-commit.md +68 -0
- package/Dev/i18n/en/VueJS/commands/check-architecture.md +137 -0
- package/Dev/i18n/en/VueJS/commands/check-code-quality.md +152 -0
- package/Dev/i18n/en/VueJS/commands/check-compliance.md +124 -0
- package/Dev/i18n/en/VueJS/commands/check-security.md +186 -0
- package/Dev/i18n/en/VueJS/commands/check-testing.md +185 -0
- package/Dev/i18n/en/VueJS/commands/generate-component.md +233 -0
- package/Dev/i18n/en/VueJS/rules/00-project-context.md.template +125 -0
- package/Dev/i18n/en/VueJS/rules/02-architecture-vuejs.md +375 -0
- package/Dev/i18n/en/VueJS/rules/03-coding-standards.md +502 -0
- package/Dev/i18n/en/VueJS/rules/06-tooling.md +422 -0
- package/Dev/i18n/en/VueJS/rules/07-testing-vuejs.md +606 -0
- package/Dev/i18n/en/VueJS/rules/08-quality-tools.md +441 -0
- package/Dev/i18n/en/VueJS/rules/11-security-vuejs.md +465 -0
- package/Dev/i18n/en/VueJS/templates/component.template.vue +133 -0
- package/Dev/i18n/en/VueJS/templates/composable.template.ts +162 -0
- package/Dev/i18n/en/VueJS/templates/store.template.ts +282 -0
- package/Dev/i18n/en/VueJS/templates/test.template.ts +233 -0
- package/Dev/i18n/es/Angular/CLAUDE.md.template +49 -0
- package/Dev/i18n/es/Angular/agents/angular-reviewer.md +213 -0
- package/Dev/i18n/es/Angular/checklists/new-feature.md +125 -0
- package/Dev/i18n/es/Angular/checklists/pre-commit.md +77 -0
- package/Dev/i18n/es/Angular/commands/check-architecture.md +261 -0
- package/Dev/i18n/es/Angular/commands/check-code-quality.md +238 -0
- package/Dev/i18n/es/Angular/commands/check-compliance.md +199 -0
- package/Dev/i18n/es/Angular/commands/check-security.md +263 -0
- package/Dev/i18n/es/Angular/commands/check-testing.md +292 -0
- package/Dev/i18n/es/Angular/commands/generate-component.md +220 -0
- package/Dev/i18n/es/Angular/rules/00-project-context.md.template +78 -0
- package/Dev/i18n/es/Angular/rules/02-architecture-angular.md +477 -0
- package/Dev/i18n/es/Angular/rules/03-coding-standards.md +640 -0
- package/Dev/i18n/es/Angular/rules/06-tooling.md +516 -0
- package/Dev/i18n/es/Angular/rules/07-testing-angular.md +739 -0
- package/Dev/i18n/es/Angular/rules/08-quality-tools.md +501 -0
- package/Dev/i18n/es/Angular/rules/11-security-angular.md +497 -0
- package/Dev/i18n/es/Angular/templates/component.template.ts +115 -0
- package/Dev/i18n/es/Angular/templates/service.template.ts +203 -0
- package/Dev/i18n/es/CSharp/CLAUDE.md.template +65 -0
- package/Dev/i18n/es/CSharp/agents/csharp-reviewer.md +166 -0
- package/Dev/i18n/es/CSharp/checklists/new-feature.md +178 -0
- package/Dev/i18n/es/CSharp/checklists/pre-commit.md +126 -0
- package/Dev/i18n/es/CSharp/commands/check-architecture.md +294 -0
- package/Dev/i18n/es/CSharp/commands/check-code-quality.md +355 -0
- package/Dev/i18n/es/CSharp/commands/check-compliance.md +178 -0
- package/Dev/i18n/es/CSharp/commands/check-security.md +369 -0
- package/Dev/i18n/es/CSharp/commands/check-testing.md +295 -0
- package/Dev/i18n/es/CSharp/commands/generate-feature.md +481 -0
- package/Dev/i18n/es/CSharp/rules/00-project-context.md.template +100 -0
- package/Dev/i18n/es/CSharp/rules/02-architecture-csharp.md +536 -0
- package/Dev/i18n/es/CSharp/rules/03-coding-standards.md +494 -0
- package/Dev/i18n/es/CSharp/rules/06-tooling.md +493 -0
- package/Dev/i18n/es/CSharp/rules/07-testing-csharp.md +566 -0
- package/Dev/i18n/es/CSharp/rules/08-quality-tools.md +497 -0
- package/Dev/i18n/es/CSharp/rules/11-security-csharp.md +568 -0
- package/Dev/i18n/es/CSharp/rules/12-aspire-cloud-native.md +514 -0
- package/Dev/i18n/es/CSharp/templates/command-handler.template.cs +100 -0
- package/Dev/i18n/es/CSharp/templates/entity.template.cs +159 -0
- package/Dev/i18n/es/Common/commands/add-technology.md +195 -0
- package/Dev/i18n/es/Laravel/CLAUDE.md.template +104 -0
- package/Dev/i18n/es/Laravel/agents/laravel-reviewer.md +200 -0
- package/Dev/i18n/es/Laravel/checklists/new-feature.md +277 -0
- package/Dev/i18n/es/Laravel/checklists/pre-commit.md +156 -0
- package/Dev/i18n/es/Laravel/commands/check-architecture.md +306 -0
- package/Dev/i18n/es/Laravel/commands/check-code-quality.md +302 -0
- package/Dev/i18n/es/Laravel/commands/check-compliance.md +141 -0
- package/Dev/i18n/es/Laravel/commands/check-security.md +372 -0
- package/Dev/i18n/es/Laravel/commands/check-testing.md +397 -0
- package/Dev/i18n/es/Laravel/commands/generate-controller.md +388 -0
- package/Dev/i18n/es/Laravel/rules/00-project-context.md.template +140 -0
- package/Dev/i18n/es/Laravel/rules/02-architecture-laravel.md +644 -0
- package/Dev/i18n/es/Laravel/rules/03-coding-standards.md +573 -0
- package/Dev/i18n/es/Laravel/rules/06-tooling.md +580 -0
- package/Dev/i18n/es/Laravel/rules/07-testing-laravel.md +525 -0
- package/Dev/i18n/es/Laravel/rules/08-quality-tools.md +591 -0
- package/Dev/i18n/es/Laravel/rules/11-security-laravel.md +787 -0
- package/Dev/i18n/es/Laravel/templates/action.template.php +79 -0
- package/Dev/i18n/es/Laravel/templates/controller.template.php +99 -0
- package/Dev/i18n/es/Laravel/templates/model.template.php +206 -0
- package/Dev/i18n/es/Laravel/templates/test.template.php +263 -0
- package/Dev/i18n/es/PHP/CLAUDE.md.template +460 -0
- package/Dev/i18n/es/PHP/agents/php-reviewer.md +345 -0
- package/Dev/i18n/es/PHP/checklists/new-feature.md +132 -0
- package/Dev/i18n/es/PHP/checklists/pre-commit.md +231 -0
- package/Dev/i18n/es/PHP/commands/check-architecture.md +557 -0
- package/Dev/i18n/es/PHP/commands/check-code-quality.md +448 -0
- package/Dev/i18n/es/PHP/commands/check-compliance.md +477 -0
- package/Dev/i18n/es/PHP/commands/check-security.md +420 -0
- package/Dev/i18n/es/PHP/commands/check-testing.md +486 -0
- package/Dev/i18n/es/PHP/rules/00-project-context.md.template +266 -0
- package/Dev/i18n/es/PHP/rules/02-architecture-php.md +696 -0
- package/Dev/i18n/es/PHP/rules/03-coding-standards.md +641 -0
- package/Dev/i18n/es/PHP/rules/06-tooling.md +543 -0
- package/Dev/i18n/es/PHP/rules/07-testing-php.md +636 -0
- package/Dev/i18n/es/PHP/rules/08-quality-tools.md +533 -0
- package/Dev/i18n/es/PHP/rules/11-security-php.md +759 -0
- package/Dev/i18n/es/PHP/templates/entity.md +435 -0
- package/Dev/i18n/es/PHP/templates/use-case.md +512 -0
- package/Dev/i18n/es/PHP/templates/value-object.md +555 -0
- package/Dev/i18n/es/VueJS/CLAUDE.md.template +102 -0
- package/Dev/i18n/es/VueJS/agents/vuejs-reviewer.md +206 -0
- package/Dev/i18n/es/VueJS/checklists/new-feature.md +131 -0
- package/Dev/i18n/es/VueJS/checklists/pre-commit.md +68 -0
- package/Dev/i18n/es/VueJS/commands/check-architecture.md +137 -0
- package/Dev/i18n/es/VueJS/commands/check-code-quality.md +152 -0
- package/Dev/i18n/es/VueJS/commands/check-compliance.md +124 -0
- package/Dev/i18n/es/VueJS/commands/check-security.md +186 -0
- package/Dev/i18n/es/VueJS/commands/check-testing.md +185 -0
- package/Dev/i18n/es/VueJS/commands/generate-component.md +233 -0
- package/Dev/i18n/es/VueJS/rules/00-project-context.md.template +125 -0
- package/Dev/i18n/es/VueJS/rules/02-architecture-vuejs.md +375 -0
- package/Dev/i18n/es/VueJS/rules/03-coding-standards.md +502 -0
- package/Dev/i18n/es/VueJS/rules/06-tooling.md +422 -0
- package/Dev/i18n/es/VueJS/rules/07-testing-vuejs.md +606 -0
- package/Dev/i18n/es/VueJS/rules/08-quality-tools.md +441 -0
- package/Dev/i18n/es/VueJS/rules/11-security-vuejs.md +465 -0
- package/Dev/i18n/es/VueJS/templates/component.template.vue +133 -0
- package/Dev/i18n/es/VueJS/templates/composable.template.ts +162 -0
- package/Dev/i18n/es/VueJS/templates/store.template.ts +282 -0
- package/Dev/i18n/es/VueJS/templates/test.template.ts +233 -0
- package/Dev/i18n/fr/Angular/CLAUDE.md.template +49 -0
- package/Dev/i18n/fr/Angular/agents/angular-reviewer.md +213 -0
- package/Dev/i18n/fr/Angular/checklists/new-feature.md +125 -0
- package/Dev/i18n/fr/Angular/checklists/pre-commit.md +77 -0
- package/Dev/i18n/fr/Angular/commands/check-architecture.md +261 -0
- package/Dev/i18n/fr/Angular/commands/check-code-quality.md +238 -0
- package/Dev/i18n/fr/Angular/commands/check-compliance.md +199 -0
- package/Dev/i18n/fr/Angular/commands/check-security.md +263 -0
- package/Dev/i18n/fr/Angular/commands/check-testing.md +292 -0
- package/Dev/i18n/fr/Angular/commands/generate-component.md +220 -0
- package/Dev/i18n/fr/Angular/rules/00-project-context.md.template +78 -0
- package/Dev/i18n/fr/Angular/rules/02-architecture-angular.md +477 -0
- package/Dev/i18n/fr/Angular/rules/03-coding-standards.md +640 -0
- package/Dev/i18n/fr/Angular/rules/06-tooling.md +516 -0
- package/Dev/i18n/fr/Angular/rules/07-testing-angular.md +739 -0
- package/Dev/i18n/fr/Angular/rules/08-quality-tools.md +501 -0
- package/Dev/i18n/fr/Angular/rules/11-security-angular.md +497 -0
- package/Dev/i18n/fr/Angular/templates/component.template.ts +115 -0
- package/Dev/i18n/fr/Angular/templates/service.template.ts +203 -0
- package/Dev/i18n/fr/CSharp/CLAUDE.md.template +65 -0
- package/Dev/i18n/fr/CSharp/agents/csharp-reviewer.md +166 -0
- package/Dev/i18n/fr/CSharp/checklists/new-feature.md +178 -0
- package/Dev/i18n/fr/CSharp/checklists/pre-commit.md +126 -0
- package/Dev/i18n/fr/CSharp/commands/check-architecture.md +294 -0
- package/Dev/i18n/fr/CSharp/commands/check-code-quality.md +355 -0
- package/Dev/i18n/fr/CSharp/commands/check-compliance.md +178 -0
- package/Dev/i18n/fr/CSharp/commands/check-security.md +369 -0
- package/Dev/i18n/fr/CSharp/commands/check-testing.md +295 -0
- package/Dev/i18n/fr/CSharp/commands/generate-feature.md +481 -0
- package/Dev/i18n/fr/CSharp/rules/00-project-context.md.template +100 -0
- package/Dev/i18n/fr/CSharp/rules/02-architecture-csharp.md +536 -0
- package/Dev/i18n/fr/CSharp/rules/03-coding-standards.md +494 -0
- package/Dev/i18n/fr/CSharp/rules/06-tooling.md +493 -0
- package/Dev/i18n/fr/CSharp/rules/07-testing-csharp.md +566 -0
- package/Dev/i18n/fr/CSharp/rules/08-quality-tools.md +497 -0
- package/Dev/i18n/fr/CSharp/rules/11-security-csharp.md +568 -0
- package/Dev/i18n/fr/CSharp/rules/12-aspire-cloud-native.md +514 -0
- package/Dev/i18n/fr/CSharp/templates/command-handler.template.cs +100 -0
- package/Dev/i18n/fr/CSharp/templates/entity.template.cs +159 -0
- package/Dev/i18n/fr/Common/commands/add-technology.md +293 -0
- package/Dev/i18n/fr/Laravel/CLAUDE.md.template +104 -0
- package/Dev/i18n/fr/Laravel/agents/laravel-reviewer.md +200 -0
- package/Dev/i18n/fr/Laravel/checklists/new-feature.md +277 -0
- package/Dev/i18n/fr/Laravel/checklists/pre-commit.md +156 -0
- package/Dev/i18n/fr/Laravel/commands/check-architecture.md +306 -0
- package/Dev/i18n/fr/Laravel/commands/check-code-quality.md +302 -0
- package/Dev/i18n/fr/Laravel/commands/check-compliance.md +141 -0
- package/Dev/i18n/fr/Laravel/commands/check-security.md +372 -0
- package/Dev/i18n/fr/Laravel/commands/check-testing.md +397 -0
- package/Dev/i18n/fr/Laravel/commands/generate-controller.md +388 -0
- package/Dev/i18n/fr/Laravel/rules/00-project-context.md.template +140 -0
- package/Dev/i18n/fr/Laravel/rules/02-architecture-laravel.md +644 -0
- package/Dev/i18n/fr/Laravel/rules/03-coding-standards.md +573 -0
- package/Dev/i18n/fr/Laravel/rules/06-tooling.md +580 -0
- package/Dev/i18n/fr/Laravel/rules/07-testing-laravel.md +525 -0
- package/Dev/i18n/fr/Laravel/rules/08-quality-tools.md +591 -0
- package/Dev/i18n/fr/Laravel/rules/11-security-laravel.md +787 -0
- package/Dev/i18n/fr/Laravel/templates/action.template.php +79 -0
- package/Dev/i18n/fr/Laravel/templates/controller.template.php +99 -0
- package/Dev/i18n/fr/Laravel/templates/model.template.php +206 -0
- package/Dev/i18n/fr/Laravel/templates/test.template.php +263 -0
- package/Dev/i18n/fr/PHP/CLAUDE.md.template +460 -0
- package/Dev/i18n/fr/PHP/agents/php-reviewer.md +345 -0
- package/Dev/i18n/fr/PHP/checklists/new-feature.md +132 -0
- package/Dev/i18n/fr/PHP/checklists/pre-commit.md +231 -0
- package/Dev/i18n/fr/PHP/commands/check-architecture.md +557 -0
- package/Dev/i18n/fr/PHP/commands/check-code-quality.md +448 -0
- package/Dev/i18n/fr/PHP/commands/check-compliance.md +477 -0
- package/Dev/i18n/fr/PHP/commands/check-security.md +420 -0
- package/Dev/i18n/fr/PHP/commands/check-testing.md +486 -0
- package/Dev/i18n/fr/PHP/rules/00-project-context.md.template +266 -0
- package/Dev/i18n/fr/PHP/rules/02-architecture-php.md +506 -0
- package/Dev/i18n/fr/PHP/rules/03-coding-standards.md +585 -0
- package/Dev/i18n/fr/PHP/rules/06-tooling.md +543 -0
- package/Dev/i18n/fr/PHP/rules/07-testing-php.md +636 -0
- package/Dev/i18n/fr/PHP/rules/08-quality-tools.md +533 -0
- package/Dev/i18n/fr/PHP/rules/11-security-php.md +642 -0
- package/Dev/i18n/fr/PHP/templates/entity.md +435 -0
- package/Dev/i18n/fr/PHP/templates/use-case.md +512 -0
- package/Dev/i18n/fr/PHP/templates/value-object.md +555 -0
- package/Dev/i18n/fr/VueJS/CLAUDE.md.template +102 -0
- package/Dev/i18n/fr/VueJS/agents/vuejs-reviewer.md +206 -0
- package/Dev/i18n/fr/VueJS/checklists/new-feature.md +131 -0
- package/Dev/i18n/fr/VueJS/checklists/pre-commit.md +68 -0
- package/Dev/i18n/fr/VueJS/commands/check-architecture.md +137 -0
- package/Dev/i18n/fr/VueJS/commands/check-code-quality.md +152 -0
- package/Dev/i18n/fr/VueJS/commands/check-compliance.md +124 -0
- package/Dev/i18n/fr/VueJS/commands/check-security.md +186 -0
- package/Dev/i18n/fr/VueJS/commands/check-testing.md +185 -0
- package/Dev/i18n/fr/VueJS/commands/generate-component.md +233 -0
- package/Dev/i18n/fr/VueJS/rules/00-project-context.md.template +125 -0
- package/Dev/i18n/fr/VueJS/rules/02-architecture-vuejs.md +375 -0
- package/Dev/i18n/fr/VueJS/rules/03-coding-standards.md +502 -0
- package/Dev/i18n/fr/VueJS/rules/06-tooling.md +422 -0
- package/Dev/i18n/fr/VueJS/rules/07-testing-vuejs.md +606 -0
- package/Dev/i18n/fr/VueJS/rules/08-quality-tools.md +441 -0
- package/Dev/i18n/fr/VueJS/rules/11-security-vuejs.md +465 -0
- package/Dev/i18n/fr/VueJS/templates/component.template.vue +133 -0
- package/Dev/i18n/fr/VueJS/templates/composable.template.ts +162 -0
- package/Dev/i18n/fr/VueJS/templates/store.template.ts +282 -0
- package/Dev/i18n/fr/VueJS/templates/test.template.ts +233 -0
- package/Dev/i18n/pt/Angular/CLAUDE.md.template +49 -0
- package/Dev/i18n/pt/Angular/agents/angular-reviewer.md +213 -0
- package/Dev/i18n/pt/Angular/checklists/new-feature.md +125 -0
- package/Dev/i18n/pt/Angular/checklists/pre-commit.md +77 -0
- package/Dev/i18n/pt/Angular/commands/check-architecture.md +261 -0
- package/Dev/i18n/pt/Angular/commands/check-code-quality.md +238 -0
- package/Dev/i18n/pt/Angular/commands/check-compliance.md +199 -0
- package/Dev/i18n/pt/Angular/commands/check-security.md +263 -0
- package/Dev/i18n/pt/Angular/commands/check-testing.md +292 -0
- package/Dev/i18n/pt/Angular/commands/generate-component.md +220 -0
- package/Dev/i18n/pt/Angular/rules/00-project-context.md.template +78 -0
- package/Dev/i18n/pt/Angular/rules/02-architecture-angular.md +477 -0
- package/Dev/i18n/pt/Angular/rules/03-coding-standards.md +640 -0
- package/Dev/i18n/pt/Angular/rules/06-tooling.md +516 -0
- package/Dev/i18n/pt/Angular/rules/07-testing-angular.md +739 -0
- package/Dev/i18n/pt/Angular/rules/08-quality-tools.md +501 -0
- package/Dev/i18n/pt/Angular/rules/11-security-angular.md +497 -0
- package/Dev/i18n/pt/Angular/templates/component.template.ts +115 -0
- package/Dev/i18n/pt/Angular/templates/service.template.ts +203 -0
- package/Dev/i18n/pt/CSharp/CLAUDE.md.template +65 -0
- package/Dev/i18n/pt/CSharp/agents/csharp-reviewer.md +166 -0
- package/Dev/i18n/pt/CSharp/checklists/new-feature.md +178 -0
- package/Dev/i18n/pt/CSharp/checklists/pre-commit.md +126 -0
- package/Dev/i18n/pt/CSharp/commands/check-architecture.md +294 -0
- package/Dev/i18n/pt/CSharp/commands/check-code-quality.md +355 -0
- package/Dev/i18n/pt/CSharp/commands/check-compliance.md +178 -0
- package/Dev/i18n/pt/CSharp/commands/check-security.md +369 -0
- package/Dev/i18n/pt/CSharp/commands/check-testing.md +295 -0
- package/Dev/i18n/pt/CSharp/commands/generate-feature.md +481 -0
- package/Dev/i18n/pt/CSharp/rules/00-project-context.md.template +100 -0
- package/Dev/i18n/pt/CSharp/rules/02-architecture-csharp.md +536 -0
- package/Dev/i18n/pt/CSharp/rules/03-coding-standards.md +494 -0
- package/Dev/i18n/pt/CSharp/rules/06-tooling.md +493 -0
- package/Dev/i18n/pt/CSharp/rules/07-testing-csharp.md +566 -0
- package/Dev/i18n/pt/CSharp/rules/08-quality-tools.md +497 -0
- package/Dev/i18n/pt/CSharp/rules/11-security-csharp.md +568 -0
- package/Dev/i18n/pt/CSharp/rules/12-aspire-cloud-native.md +514 -0
- package/Dev/i18n/pt/CSharp/templates/command-handler.template.cs +100 -0
- package/Dev/i18n/pt/CSharp/templates/entity.template.cs +159 -0
- package/Dev/i18n/pt/Common/commands/add-technology.md +195 -0
- package/Dev/i18n/pt/Laravel/CLAUDE.md.template +104 -0
- package/Dev/i18n/pt/Laravel/agents/laravel-reviewer.md +200 -0
- package/Dev/i18n/pt/Laravel/checklists/new-feature.md +277 -0
- package/Dev/i18n/pt/Laravel/checklists/pre-commit.md +156 -0
- package/Dev/i18n/pt/Laravel/commands/check-architecture.md +306 -0
- package/Dev/i18n/pt/Laravel/commands/check-code-quality.md +302 -0
- package/Dev/i18n/pt/Laravel/commands/check-compliance.md +141 -0
- package/Dev/i18n/pt/Laravel/commands/check-security.md +372 -0
- package/Dev/i18n/pt/Laravel/commands/check-testing.md +397 -0
- package/Dev/i18n/pt/Laravel/commands/generate-controller.md +388 -0
- package/Dev/i18n/pt/Laravel/rules/00-project-context.md.template +140 -0
- package/Dev/i18n/pt/Laravel/rules/02-architecture-laravel.md +644 -0
- package/Dev/i18n/pt/Laravel/rules/03-coding-standards.md +573 -0
- package/Dev/i18n/pt/Laravel/rules/06-tooling.md +580 -0
- package/Dev/i18n/pt/Laravel/rules/07-testing-laravel.md +525 -0
- package/Dev/i18n/pt/Laravel/rules/08-quality-tools.md +591 -0
- package/Dev/i18n/pt/Laravel/rules/11-security-laravel.md +787 -0
- package/Dev/i18n/pt/Laravel/templates/action.template.php +79 -0
- package/Dev/i18n/pt/Laravel/templates/controller.template.php +99 -0
- package/Dev/i18n/pt/Laravel/templates/model.template.php +206 -0
- package/Dev/i18n/pt/Laravel/templates/test.template.php +263 -0
- package/Dev/i18n/pt/PHP/CLAUDE.md.template +460 -0
- package/Dev/i18n/pt/PHP/agents/php-reviewer.md +345 -0
- package/Dev/i18n/pt/PHP/checklists/new-feature.md +132 -0
- package/Dev/i18n/pt/PHP/checklists/pre-commit.md +231 -0
- package/Dev/i18n/pt/PHP/commands/check-architecture.md +557 -0
- package/Dev/i18n/pt/PHP/commands/check-code-quality.md +448 -0
- package/Dev/i18n/pt/PHP/commands/check-compliance.md +477 -0
- package/Dev/i18n/pt/PHP/commands/check-security.md +420 -0
- package/Dev/i18n/pt/PHP/commands/check-testing.md +486 -0
- package/Dev/i18n/pt/PHP/rules/00-project-context.md.template +266 -0
- package/Dev/i18n/pt/PHP/rules/02-architecture-php.md +696 -0
- package/Dev/i18n/pt/PHP/rules/03-coding-standards.md +641 -0
- package/Dev/i18n/pt/PHP/rules/06-tooling.md +543 -0
- package/Dev/i18n/pt/PHP/rules/07-testing-php.md +636 -0
- package/Dev/i18n/pt/PHP/rules/08-quality-tools.md +533 -0
- package/Dev/i18n/pt/PHP/rules/11-security-php.md +759 -0
- package/Dev/i18n/pt/PHP/templates/entity.md +435 -0
- package/Dev/i18n/pt/PHP/templates/use-case.md +512 -0
- package/Dev/i18n/pt/PHP/templates/value-object.md +555 -0
- package/Dev/i18n/pt/VueJS/CLAUDE.md.template +102 -0
- package/Dev/i18n/pt/VueJS/agents/vuejs-reviewer.md +206 -0
- package/Dev/i18n/pt/VueJS/checklists/new-feature.md +131 -0
- package/Dev/i18n/pt/VueJS/checklists/pre-commit.md +68 -0
- package/Dev/i18n/pt/VueJS/commands/check-architecture.md +137 -0
- package/Dev/i18n/pt/VueJS/commands/check-code-quality.md +152 -0
- package/Dev/i18n/pt/VueJS/commands/check-compliance.md +124 -0
- package/Dev/i18n/pt/VueJS/commands/check-security.md +186 -0
- package/Dev/i18n/pt/VueJS/commands/check-testing.md +185 -0
- package/Dev/i18n/pt/VueJS/commands/generate-component.md +233 -0
- package/Dev/i18n/pt/VueJS/rules/00-project-context.md.template +125 -0
- package/Dev/i18n/pt/VueJS/rules/02-architecture-vuejs.md +375 -0
- package/Dev/i18n/pt/VueJS/rules/03-coding-standards.md +502 -0
- package/Dev/i18n/pt/VueJS/rules/06-tooling.md +422 -0
- package/Dev/i18n/pt/VueJS/rules/07-testing-vuejs.md +606 -0
- package/Dev/i18n/pt/VueJS/rules/08-quality-tools.md +441 -0
- package/Dev/i18n/pt/VueJS/rules/11-security-vuejs.md +465 -0
- package/Dev/i18n/pt/VueJS/templates/component.template.vue +133 -0
- package/Dev/i18n/pt/VueJS/templates/composable.template.ts +162 -0
- package/Dev/i18n/pt/VueJS/templates/store.template.ts +282 -0
- package/Dev/i18n/pt/VueJS/templates/test.template.ts +233 -0
- package/Dev/scripts/install-angular-rules.sh +543 -0
- package/Dev/scripts/install-common-rules.sh +13 -1
- package/Dev/scripts/install-csharp-rules.sh +544 -0
- package/Dev/scripts/install-flutter-rules.sh +17 -4
- package/Dev/scripts/install-from-config.sh +61 -23
- package/Dev/scripts/install-laravel-rules.sh +552 -0
- package/Dev/scripts/install-php-rules.sh +537 -0
- package/Dev/scripts/install-python-rules.sh +17 -4
- package/Dev/scripts/install-react-rules.sh +17 -4
- package/Dev/scripts/install-reactnative-rules.sh +17 -4
- package/Dev/scripts/install-symfony-rules.sh +22 -4
- package/Dev/scripts/install-vuejs-rules.sh +588 -0
- package/README.md +68 -2
- package/Tools/Ralph/README.md +106 -10
- package/Tools/Ralph/lib/checkpoint.sh +15 -9
- package/Tools/Ralph/lib/circuit-breaker.sh +16 -7
- package/Tools/Ralph/lib/context-manager.sh +473 -0
- package/Tools/Ralph/lib/context-reconstruction.sh +329 -0
- package/Tools/Ralph/lib/dod-validator.sh +17 -4
- package/Tools/Ralph/lib/loop.sh +33 -10
- package/Tools/Ralph/lib/session.sh +88 -33
- package/Tools/Ralph/lib/sprint-progress.sh +832 -0
- package/Tools/Ralph/lib/utils.sh +362 -0
- package/Tools/Ralph/ralph.sh +172 -14
- package/Tools/Ralph/templates/ralph.yml.template +87 -0
- package/Tools/Ralph/templates/sprint-progress.md.template +72 -0
- package/Tools/i18n/ralph/de.sh +31 -0
- package/Tools/i18n/ralph/en.sh +31 -0
- package/Tools/i18n/ralph/es.sh +31 -0
- package/Tools/i18n/ralph/fr.sh +31 -0
- package/Tools/i18n/ralph/pt.sh +31 -0
- package/package.json +1 -1
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
# PHP Coding Standards
|
|
2
|
+
|
|
3
|
+
## PSR Standards Compliance
|
|
4
|
+
|
|
5
|
+
### PSR-1: Basic Coding Standard
|
|
6
|
+
|
|
7
|
+
```php
|
|
8
|
+
<?php
|
|
9
|
+
// Files MUST use only <?php tags
|
|
10
|
+
// Files MUST use UTF-8 without BOM
|
|
11
|
+
// Files should EITHER declare symbols OR execute logic, not both
|
|
12
|
+
|
|
13
|
+
declare(strict_types=1);
|
|
14
|
+
|
|
15
|
+
namespace App\Domain\Entity;
|
|
16
|
+
|
|
17
|
+
// Class names MUST be declared in PascalCase
|
|
18
|
+
class UserAccount
|
|
19
|
+
{
|
|
20
|
+
// Class constants MUST be declared in UPPER_SNAKE_CASE
|
|
21
|
+
public const STATUS_ACTIVE = 'active';
|
|
22
|
+
public const MAX_LOGIN_ATTEMPTS = 5;
|
|
23
|
+
|
|
24
|
+
// Method names MUST be declared in camelCase
|
|
25
|
+
public function getUserById(int $id): ?User
|
|
26
|
+
{
|
|
27
|
+
// Implementation
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### PSR-12: Extended Coding Style
|
|
33
|
+
|
|
34
|
+
```php
|
|
35
|
+
<?php
|
|
36
|
+
|
|
37
|
+
declare(strict_types=1);
|
|
38
|
+
|
|
39
|
+
namespace App\Application\Service;
|
|
40
|
+
|
|
41
|
+
use App\Domain\Entity\User;
|
|
42
|
+
use App\Domain\Repository\UserRepositoryInterface;
|
|
43
|
+
use App\Domain\ValueObject\Email;
|
|
44
|
+
use Psr\Log\LoggerInterface;
|
|
45
|
+
|
|
46
|
+
// Opening brace for class on new line
|
|
47
|
+
final class UserService
|
|
48
|
+
{
|
|
49
|
+
// Constructor property promotion (PHP 8+)
|
|
50
|
+
public function __construct(
|
|
51
|
+
private readonly UserRepositoryInterface $userRepository,
|
|
52
|
+
private readonly LoggerInterface $logger,
|
|
53
|
+
) {}
|
|
54
|
+
|
|
55
|
+
// Opening brace for method on new line
|
|
56
|
+
public function findByEmail(string $email): ?User
|
|
57
|
+
{
|
|
58
|
+
// 4 spaces indentation
|
|
59
|
+
return $this->userRepository->findByEmail(
|
|
60
|
+
Email::fromString($email)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Control structure braces on same line
|
|
65
|
+
public function processUsers(array $users): void
|
|
66
|
+
{
|
|
67
|
+
if (empty($users)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
foreach ($users as $user) {
|
|
72
|
+
if (!$user->isActive()) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
$this->processUser($user);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### PSR-4: Autoloading
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
// composer.json
|
|
86
|
+
{
|
|
87
|
+
"autoload": {
|
|
88
|
+
"psr-4": {
|
|
89
|
+
"App\\": "src/"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"autoload-dev": {
|
|
93
|
+
"psr-4": {
|
|
94
|
+
"App\\Tests\\": "tests/"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Namespace to file path mapping:**
|
|
101
|
+
- `App\Domain\Entity\User` → `src/Domain/Entity/User.php`
|
|
102
|
+
- `App\Application\Service\UserService` → `src/Application/Service/UserService.php`
|
|
103
|
+
- `App\Tests\Unit\Domain\Entity\UserTest` → `tests/Unit/Domain/Entity/UserTest.php`
|
|
104
|
+
|
|
105
|
+
## Modern PHP Features (PHP 8.x)
|
|
106
|
+
|
|
107
|
+
### Constructor Property Promotion
|
|
108
|
+
|
|
109
|
+
```php
|
|
110
|
+
<?php
|
|
111
|
+
// ❌ Old way
|
|
112
|
+
class UserService
|
|
113
|
+
{
|
|
114
|
+
private UserRepositoryInterface $repository;
|
|
115
|
+
private LoggerInterface $logger;
|
|
116
|
+
|
|
117
|
+
public function __construct(
|
|
118
|
+
UserRepositoryInterface $repository,
|
|
119
|
+
LoggerInterface $logger
|
|
120
|
+
) {
|
|
121
|
+
$this->repository = $repository;
|
|
122
|
+
$this->logger = $logger;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ✅ PHP 8+ way
|
|
127
|
+
class UserService
|
|
128
|
+
{
|
|
129
|
+
public function __construct(
|
|
130
|
+
private readonly UserRepositoryInterface $repository,
|
|
131
|
+
private readonly LoggerInterface $logger,
|
|
132
|
+
) {}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Readonly Classes & Properties (PHP 8.1+)
|
|
137
|
+
|
|
138
|
+
```php
|
|
139
|
+
<?php
|
|
140
|
+
// Readonly properties (PHP 8.1)
|
|
141
|
+
class User
|
|
142
|
+
{
|
|
143
|
+
public function __construct(
|
|
144
|
+
public readonly string $id,
|
|
145
|
+
public readonly string $email,
|
|
146
|
+
) {}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Readonly class (PHP 8.2)
|
|
150
|
+
readonly class Email
|
|
151
|
+
{
|
|
152
|
+
public function __construct(
|
|
153
|
+
public string $value,
|
|
154
|
+
) {}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Enums (PHP 8.1+)
|
|
159
|
+
|
|
160
|
+
```php
|
|
161
|
+
<?php
|
|
162
|
+
|
|
163
|
+
declare(strict_types=1);
|
|
164
|
+
|
|
165
|
+
namespace App\Domain\Enum;
|
|
166
|
+
|
|
167
|
+
// Basic enum
|
|
168
|
+
enum UserStatus: string
|
|
169
|
+
{
|
|
170
|
+
case PENDING = 'pending';
|
|
171
|
+
case ACTIVE = 'active';
|
|
172
|
+
case SUSPENDED = 'suspended';
|
|
173
|
+
case DELETED = 'deleted';
|
|
174
|
+
|
|
175
|
+
public function isActive(): bool
|
|
176
|
+
{
|
|
177
|
+
return $this === self::ACTIVE;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
public function canLogin(): bool
|
|
181
|
+
{
|
|
182
|
+
return match ($this) {
|
|
183
|
+
self::ACTIVE => true,
|
|
184
|
+
default => false,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Usage
|
|
190
|
+
$status = UserStatus::ACTIVE;
|
|
191
|
+
$status->value; // 'active'
|
|
192
|
+
$status->name; // 'ACTIVE'
|
|
193
|
+
UserStatus::from('active'); // UserStatus::ACTIVE
|
|
194
|
+
UserStatus::tryFrom('invalid'); // null
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Named Arguments
|
|
198
|
+
|
|
199
|
+
```php
|
|
200
|
+
<?php
|
|
201
|
+
// ✅ Named arguments for clarity
|
|
202
|
+
$user = new User(
|
|
203
|
+
id: UserId::generate(),
|
|
204
|
+
email: Email::fromString('john@example.com'),
|
|
205
|
+
name: 'John Doe',
|
|
206
|
+
status: UserStatus::PENDING,
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
// ✅ Skip optional parameters
|
|
210
|
+
function createNotification(
|
|
211
|
+
string $message,
|
|
212
|
+
string $type = 'info',
|
|
213
|
+
bool $persistent = false,
|
|
214
|
+
?string $icon = null,
|
|
215
|
+
): Notification {
|
|
216
|
+
// ...
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
createNotification(
|
|
220
|
+
message: 'User created',
|
|
221
|
+
persistent: true,
|
|
222
|
+
// type and icon use defaults
|
|
223
|
+
);
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Match Expression
|
|
227
|
+
|
|
228
|
+
```php
|
|
229
|
+
<?php
|
|
230
|
+
// ❌ Old switch
|
|
231
|
+
function getStatusLabel(UserStatus $status): string
|
|
232
|
+
{
|
|
233
|
+
switch ($status) {
|
|
234
|
+
case UserStatus::PENDING:
|
|
235
|
+
return 'En attente';
|
|
236
|
+
case UserStatus::ACTIVE:
|
|
237
|
+
return 'Actif';
|
|
238
|
+
default:
|
|
239
|
+
return 'Inconnu';
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// ✅ Match expression (PHP 8+)
|
|
244
|
+
function getStatusLabel(UserStatus $status): string
|
|
245
|
+
{
|
|
246
|
+
return match ($status) {
|
|
247
|
+
UserStatus::PENDING => 'En attente',
|
|
248
|
+
UserStatus::ACTIVE => 'Actif',
|
|
249
|
+
UserStatus::SUSPENDED => 'Suspendu',
|
|
250
|
+
UserStatus::DELETED => 'Supprimé',
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Null Safe Operator
|
|
256
|
+
|
|
257
|
+
```php
|
|
258
|
+
<?php
|
|
259
|
+
// ❌ Old way
|
|
260
|
+
$country = null;
|
|
261
|
+
if ($user !== null) {
|
|
262
|
+
$address = $user->getAddress();
|
|
263
|
+
if ($address !== null) {
|
|
264
|
+
$country = $address->getCountry();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// ✅ Null safe operator (PHP 8+)
|
|
269
|
+
$country = $user?->getAddress()?->getCountry();
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Union & Intersection Types
|
|
273
|
+
|
|
274
|
+
```php
|
|
275
|
+
<?php
|
|
276
|
+
// Union types (PHP 8.0)
|
|
277
|
+
function process(string|int $value): string|null
|
|
278
|
+
{
|
|
279
|
+
// Can accept string or int, returns string or null
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Intersection types (PHP 8.1)
|
|
283
|
+
function handleRequest(RequestInterface&LoggableInterface $request): void
|
|
284
|
+
{
|
|
285
|
+
// Must implement both interfaces
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// DNF types (PHP 8.2)
|
|
289
|
+
function handle((A&B)|C $value): void
|
|
290
|
+
{
|
|
291
|
+
// (A and B) or C
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Property Hooks (PHP 8.4)
|
|
296
|
+
|
|
297
|
+
```php
|
|
298
|
+
<?php
|
|
299
|
+
// PHP 8.4 property hooks
|
|
300
|
+
class User
|
|
301
|
+
{
|
|
302
|
+
public string $email {
|
|
303
|
+
set {
|
|
304
|
+
if (!filter_var($value, FILTER_VALIDATE_EMAIL)) {
|
|
305
|
+
throw new InvalidArgumentException('Invalid email');
|
|
306
|
+
}
|
|
307
|
+
$this->email = strtolower($value);
|
|
308
|
+
}
|
|
309
|
+
get => $this->email;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
public string $fullName {
|
|
313
|
+
get => $this->firstName . ' ' . $this->lastName;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## Type Declarations
|
|
319
|
+
|
|
320
|
+
### Strict Types
|
|
321
|
+
|
|
322
|
+
```php
|
|
323
|
+
<?php
|
|
324
|
+
// ALWAYS declare strict_types at the top of every file
|
|
325
|
+
declare(strict_types=1);
|
|
326
|
+
|
|
327
|
+
namespace App\Domain\Service;
|
|
328
|
+
|
|
329
|
+
class PriceCalculator
|
|
330
|
+
{
|
|
331
|
+
// Full type declarations
|
|
332
|
+
public function calculate(
|
|
333
|
+
float $basePrice,
|
|
334
|
+
int $quantity,
|
|
335
|
+
?float $discount = null,
|
|
336
|
+
): float {
|
|
337
|
+
$total = $basePrice * $quantity;
|
|
338
|
+
|
|
339
|
+
if ($discount !== null) {
|
|
340
|
+
$total -= $total * ($discount / 100);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return round($total, 2);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Return Types
|
|
349
|
+
|
|
350
|
+
```php
|
|
351
|
+
<?php
|
|
352
|
+
declare(strict_types=1);
|
|
353
|
+
|
|
354
|
+
class UserRepository
|
|
355
|
+
{
|
|
356
|
+
// Single type
|
|
357
|
+
public function find(string $id): ?User
|
|
358
|
+
{
|
|
359
|
+
// Returns User or null
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Array with PHPDoc for generics
|
|
363
|
+
/** @return User[] */
|
|
364
|
+
public function findAll(): array
|
|
365
|
+
{
|
|
366
|
+
// Returns array of User
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// Void
|
|
370
|
+
public function save(User $user): void
|
|
371
|
+
{
|
|
372
|
+
// Returns nothing
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// Never (PHP 8.1) - function never returns
|
|
376
|
+
public function throwException(): never
|
|
377
|
+
{
|
|
378
|
+
throw new RuntimeException('Error');
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// Self
|
|
382
|
+
public function withEmail(Email $email): self
|
|
383
|
+
{
|
|
384
|
+
$clone = clone $this;
|
|
385
|
+
$clone->email = $email;
|
|
386
|
+
return $clone;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
## Naming Conventions
|
|
392
|
+
|
|
393
|
+
| Element | Convention | Example |
|
|
394
|
+
|---------|-----------|---------|
|
|
395
|
+
| Classes | PascalCase | `UserRepository`, `OrderService` |
|
|
396
|
+
| Interfaces | PascalCase + Interface suffix | `UserRepositoryInterface` |
|
|
397
|
+
| Methods | camelCase | `findById`, `calculateTotal` |
|
|
398
|
+
| Variables | camelCase | `$userCount`, `$isActive` |
|
|
399
|
+
| Constants | UPPER_SNAKE_CASE | `MAX_ATTEMPTS`, `DEFAULT_LOCALE` |
|
|
400
|
+
| Properties | camelCase | `$createdAt`, `$emailAddress` |
|
|
401
|
+
| Enums | PascalCase | `UserStatus`, `OrderState` |
|
|
402
|
+
| Traits | PascalCase + Trait suffix | `TimestampableTrait` |
|
|
403
|
+
|
|
404
|
+
## Documentation
|
|
405
|
+
|
|
406
|
+
### PHPDoc Standards
|
|
407
|
+
|
|
408
|
+
```php
|
|
409
|
+
<?php
|
|
410
|
+
|
|
411
|
+
declare(strict_types=1);
|
|
412
|
+
|
|
413
|
+
namespace App\Application\Service;
|
|
414
|
+
|
|
415
|
+
use App\Domain\Entity\User;
|
|
416
|
+
use App\Domain\Exception\UserNotFoundException;
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Service for managing user operations.
|
|
420
|
+
*
|
|
421
|
+
* This service handles user creation, updates, and retrieval
|
|
422
|
+
* following domain business rules.
|
|
423
|
+
*/
|
|
424
|
+
final class UserService
|
|
425
|
+
{
|
|
426
|
+
/**
|
|
427
|
+
* Find a user by their unique identifier.
|
|
428
|
+
*
|
|
429
|
+
* @param string $id The user's UUID
|
|
430
|
+
*
|
|
431
|
+
* @throws UserNotFoundException When user is not found
|
|
432
|
+
*
|
|
433
|
+
* @return User The found user entity
|
|
434
|
+
*/
|
|
435
|
+
public function findOrFail(string $id): User
|
|
436
|
+
{
|
|
437
|
+
$user = $this->repository->find($id);
|
|
438
|
+
|
|
439
|
+
if ($user === null) {
|
|
440
|
+
throw new UserNotFoundException($id);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
return $user;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Find all active users.
|
|
448
|
+
*
|
|
449
|
+
* @param int $limit Maximum number of users to return
|
|
450
|
+
* @param int $offset Number of users to skip
|
|
451
|
+
*
|
|
452
|
+
* @return User[] Array of active user entities
|
|
453
|
+
*/
|
|
454
|
+
public function findActive(int $limit = 10, int $offset = 0): array
|
|
455
|
+
{
|
|
456
|
+
return $this->repository->findByStatus(
|
|
457
|
+
status: UserStatus::ACTIVE,
|
|
458
|
+
limit: $limit,
|
|
459
|
+
offset: $offset,
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### Generic Types with PHPStan/Psalm
|
|
466
|
+
|
|
467
|
+
```php
|
|
468
|
+
<?php
|
|
469
|
+
|
|
470
|
+
declare(strict_types=1);
|
|
471
|
+
|
|
472
|
+
namespace App\Domain\Repository;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* @template T of object
|
|
476
|
+
*/
|
|
477
|
+
interface RepositoryInterface
|
|
478
|
+
{
|
|
479
|
+
/**
|
|
480
|
+
* @param string $id
|
|
481
|
+
* @return T|null
|
|
482
|
+
*/
|
|
483
|
+
public function find(string $id): ?object;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @return array<T>
|
|
487
|
+
*/
|
|
488
|
+
public function findAll(): array;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* @param T $entity
|
|
492
|
+
*/
|
|
493
|
+
public function save(object $entity): void;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* @implements RepositoryInterface<User>
|
|
498
|
+
*/
|
|
499
|
+
final class UserRepository implements RepositoryInterface
|
|
500
|
+
{
|
|
501
|
+
// Implementation
|
|
502
|
+
}
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
## Error Handling
|
|
506
|
+
|
|
507
|
+
### Exception Hierarchy
|
|
508
|
+
|
|
509
|
+
```php
|
|
510
|
+
<?php
|
|
511
|
+
|
|
512
|
+
declare(strict_types=1);
|
|
513
|
+
|
|
514
|
+
namespace App\Domain\Exception;
|
|
515
|
+
|
|
516
|
+
// Base domain exception
|
|
517
|
+
abstract class DomainException extends \Exception
|
|
518
|
+
{
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// Specific exceptions
|
|
522
|
+
final class UserNotFoundException extends DomainException
|
|
523
|
+
{
|
|
524
|
+
public function __construct(string $userId)
|
|
525
|
+
{
|
|
526
|
+
parent::__construct(
|
|
527
|
+
sprintf('User with ID "%s" was not found', $userId)
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
final class InvalidEmailException extends DomainException
|
|
533
|
+
{
|
|
534
|
+
public function __construct(string $email)
|
|
535
|
+
{
|
|
536
|
+
parent::__construct(
|
|
537
|
+
sprintf('Email "%s" is not valid', $email)
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
### Try-Catch Best Practices
|
|
544
|
+
|
|
545
|
+
```php
|
|
546
|
+
<?php
|
|
547
|
+
// ✅ Catch specific exceptions
|
|
548
|
+
try {
|
|
549
|
+
$user = $this->userService->findOrFail($id);
|
|
550
|
+
} catch (UserNotFoundException $e) {
|
|
551
|
+
return new JsonResponse(['error' => 'User not found'], 404);
|
|
552
|
+
} catch (DomainException $e) {
|
|
553
|
+
$this->logger->error($e->getMessage());
|
|
554
|
+
return new JsonResponse(['error' => 'An error occurred'], 400);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// ❌ Avoid catching generic Exception without re-throwing
|
|
558
|
+
try {
|
|
559
|
+
$this->process();
|
|
560
|
+
} catch (\Exception $e) {
|
|
561
|
+
// Lost the exception details
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// ✅ If catching generic, log and re-throw or handle properly
|
|
565
|
+
try {
|
|
566
|
+
$this->process();
|
|
567
|
+
} catch (\Exception $e) {
|
|
568
|
+
$this->logger->critical($e->getMessage(), ['exception' => $e]);
|
|
569
|
+
throw $e;
|
|
570
|
+
}
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
## Code Organization
|
|
574
|
+
|
|
575
|
+
### File Structure
|
|
576
|
+
|
|
577
|
+
```php
|
|
578
|
+
<?php
|
|
579
|
+
// One class per file
|
|
580
|
+
// File name matches class name: UserService.php
|
|
581
|
+
|
|
582
|
+
declare(strict_types=1);
|
|
583
|
+
|
|
584
|
+
namespace App\Application\Service;
|
|
585
|
+
|
|
586
|
+
// Imports ordered:
|
|
587
|
+
// 1. PHP built-in classes
|
|
588
|
+
use DateTimeImmutable;
|
|
589
|
+
use InvalidArgumentException;
|
|
590
|
+
|
|
591
|
+
// 2. Third-party packages
|
|
592
|
+
use Psr\Log\LoggerInterface;
|
|
593
|
+
use Doctrine\ORM\EntityManagerInterface;
|
|
594
|
+
|
|
595
|
+
// 3. Application classes (alphabetical)
|
|
596
|
+
use App\Domain\Entity\User;
|
|
597
|
+
use App\Domain\Repository\UserRepositoryInterface;
|
|
598
|
+
use App\Domain\ValueObject\Email;
|
|
599
|
+
|
|
600
|
+
final class UserService
|
|
601
|
+
{
|
|
602
|
+
// Class implementation
|
|
603
|
+
}
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
### Final Classes by Default
|
|
607
|
+
|
|
608
|
+
```php
|
|
609
|
+
<?php
|
|
610
|
+
// ✅ Use final by default - composition over inheritance
|
|
611
|
+
final class UserService
|
|
612
|
+
{
|
|
613
|
+
// Cannot be extended
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
// ✅ Use abstract when extension is intended
|
|
617
|
+
abstract class AbstractRepository
|
|
618
|
+
{
|
|
619
|
+
// Meant to be extended
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// ✅ Use interfaces for contracts
|
|
623
|
+
interface UserRepositoryInterface
|
|
624
|
+
{
|
|
625
|
+
public function find(string $id): ?User;
|
|
626
|
+
}
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
## Coding Standards Checklist
|
|
630
|
+
|
|
631
|
+
- [ ] `declare(strict_types=1)` at top of every file
|
|
632
|
+
- [ ] PSR-12 formatting applied
|
|
633
|
+
- [ ] PSR-4 autoloading configured
|
|
634
|
+
- [ ] All methods have return type declarations
|
|
635
|
+
- [ ] All parameters have type declarations
|
|
636
|
+
- [ ] Properties use readonly where appropriate
|
|
637
|
+
- [ ] Enums used instead of class constants for states
|
|
638
|
+
- [ ] PHPDoc for complex methods and generics
|
|
639
|
+
- [ ] Final classes by default
|
|
640
|
+
- [ ] Specific exceptions for domain errors
|
|
641
|
+
- [ ] Named arguments for clarity on complex calls
|