diff --git a/.agents/checks/quality-gates.json b/.agents/checks/quality-gates.json index 211fcbb..c968da8 100644 --- a/.agents/checks/quality-gates.json +++ b/.agents/checks/quality-gates.json @@ -36,7 +36,7 @@ "id": "QG-006", "type": "fast", "name": "PHP Style Check", - "command": "docker compose exec php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose" + "command": "docker compose exec php vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose" }, { "id": "QG-007", diff --git a/.agents/skills/starterkit-php-style-ci/SKILL.md b/.agents/skills/starterkit-php-style-ci/SKILL.md index 1681e99..2544d69 100644 --- a/.agents/skills/starterkit-php-style-ci/SKILL.md +++ b/.agents/skills/starterkit-php-style-ci/SKILL.md @@ -17,7 +17,7 @@ Coding-Style pruefbar, reproduzierbar und regressionsarm machen. ## Verbindliche Regeln -1. MUST `vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose` fuer nicht-mutierende Pruefung nutzen (Convenience-Alias: `composer cs:check`). +1. MUST `vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose` fuer nicht-mutierende Pruefung nutzen (Convenience-Alias: `composer cs:check`). 2. MUST `composer cs:fix` nur bewusst und mit Diff-Kontrolle ausfuehren. 3. MUST Style-Check vor Merge gruen halten (lokal und optional CI). 4. MUST nach groesseren Fixes mindestens `phpunit` und `phpstan` laufen lassen. @@ -25,7 +25,7 @@ Coding-Style pruefbar, reproduzierbar und regressionsarm machen. ## Workflow -1. Baseline erfassen: `vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose`. +1. Baseline erfassen: `vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose`. 2. Falls noetig fixen: `composer cs:fix`. 3. Diff fokussiert pruefen (Imports, Braces, Nebenwirkungen). 4. Qualitaetsgates laufen lassen. diff --git a/.agents/skills/starterkit-php-style-ci/references/ci-dry-run.md b/.agents/skills/starterkit-php-style-ci/references/ci-dry-run.md index 3cd4122..5da2163 100644 --- a/.agents/skills/starterkit-php-style-ci/references/ci-dry-run.md +++ b/.agents/skills/starterkit-php-style-ci/references/ci-dry-run.md @@ -7,7 +7,7 @@ CI soll nur pruefen, nicht formatieren. ## Minimaler Check ```bash -vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose +vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose ``` ## Erwartung diff --git a/.agents/skills/starterkit-php-style-ci/references/style-workflow.md b/.agents/skills/starterkit-php-style-ci/references/style-workflow.md index 45b08aa..e794ddd 100644 --- a/.agents/skills/starterkit-php-style-ci/references/style-workflow.md +++ b/.agents/skills/starterkit-php-style-ci/references/style-workflow.md @@ -3,13 +3,13 @@ ## Commands ```bash -vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose +vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose composer cs:fix ``` ## Praktikabler Ablauf -1. Erst Style-Check laufen lassen (`vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose`). +1. Erst Style-Check laufen lassen (`vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose`). 2. Danach `cs:fix`. 3. Nur relevante Diffs uebernehmen, grosse Misch-Diffs vermeiden. 4. Anschliessend: diff --git a/CLAUDE.md b/CLAUDE.md index 839bd0f..79f6052 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -209,7 +209,7 @@ These rules are enforced by guards GR-SEC-001 through GR-SEC-009 in `.agents/che | QG-001 | PHPUnit | `vendor/bin/phpunit` | | QG-002 | PHPStan level 5 | `vendor/bin/phpstan analyse -c phpstan.neon` | | QG-003 | Architecture Contract | `vendor/bin/phpunit tests/Architecture/CoreStarterkitContractTest.php` | -| QG-006 | PHP Style | `vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose` | +| QG-006 | PHP Style | `vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose` | Additional gates (fast/periodic): QG-004 structural checks, QG-005 JS smoke, QG-007 composer-unused, QG-008 docs links, QG-009 skills sync. See gate catalog for details. diff --git a/README.md b/README.md index 6e9d245..47e6dcd 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,7 @@ docker compose exec php vendor/bin/phpstan analyse -c phpstan.neon --no-progress CI-Check (ohne Dateien zu aendern): ```bash -docker compose exec php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose +docker compose exec php vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose ``` Lokal automatisch formatieren: diff --git a/composer.json b/composer.json index 98c4ba9..4332c4c 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ } }, "scripts": { - "cs:check": "php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff --verbose", - "cs:fix": "php-cs-fixer fix --config=.php-cs-fixer.dist.php --verbose" + "cs:check": "php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run --diff --verbose", + "cs:fix": "php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --verbose" } } diff --git a/docs/howto-modul-erstellen.md b/docs/howto-modul-erstellen.md index 7ac07ba..68e20c1 100644 --- a/docs/howto-modul-erstellen.md +++ b/docs/howto-modul-erstellen.md @@ -345,7 +345,7 @@ Nicht-deklarierte Cross-Module-Imports sind verboten und werden per Architektur- - [ ] PHPUnit gruent (`vendor/bin/phpunit`) - [ ] PHPStan Level 5 gruent (`vendor/bin/phpstan analyse -c phpstan.neon`) - [ ] Architektur-Tests gruent (`tests/Architecture/`) -- [ ] PHP-CS-Fixer gruent (`vendor/bin/php-cs-fixer fix --dry-run`) +- [ ] PHP-CS-Fixer gruent (`vendor/bin/php-cs-fixer fix --config=tools/php-cs-fixer/.php-cs-fixer.dist.php --dry-run`) - [ ] AuthorizationPolicy ist im Container registriert (falls Konstruktor-Parameter vorhanden) - [ ] Alle sichtbaren Texte nutzen `t('...')` - [ ] Session-Keys verwenden `module..*` Prefix diff --git a/lib/App/Container/Registrars/ServiceFactoryRegistrar.php b/lib/App/Container/Registrars/ServiceFactoryRegistrar.php index 89f0117..ed376ab 100644 --- a/lib/App/Container/Registrars/ServiceFactoryRegistrar.php +++ b/lib/App/Container/Registrars/ServiceFactoryRegistrar.php @@ -20,9 +20,6 @@ use MintyPHP\Service\Access\AssignableRoleService; use MintyPHP\Service\Access\PermissionService; use MintyPHP\Service\Audit\AuditRecorderInterface; use MintyPHP\Service\Audit\ImportAuditInterface; -use MintyPHP\Service\Audit\NullAuditRecorder; -use MintyPHP\Service\Audit\NullImportAudit; -use MintyPHP\Service\Audit\NullUserLifecycleAudit; use MintyPHP\Service\Audit\UserLifecycleAuditInterface; use MintyPHP\Service\Auth\AuthGatewayFactory; use MintyPHP\Service\Auth\AuthRepositoryFactory; @@ -32,7 +29,6 @@ use MintyPHP\Service\CustomField\CustomFieldServicesFactory; use MintyPHP\Service\Directory\DirectoryGatewayFactory; use MintyPHP\Service\Directory\DirectoryRepositoryFactory; use MintyPHP\Service\Directory\DirectoryServicesFactory; -use MintyPHP\Service\Import\ImportRepositoryFactory; use MintyPHP\Service\Import\ImportServicesFactory; use MintyPHP\Service\Mail\MailRepositoryFactory; use MintyPHP\Service\Mail\MailServicesFactory; diff --git a/.php-cs-fixer.dist.php b/tools/php-cs-fixer/.php-cs-fixer.dist.php similarity index 65% rename from .php-cs-fixer.dist.php rename to tools/php-cs-fixer/.php-cs-fixer.dist.php index fb860c8..e38de4e 100644 --- a/.php-cs-fixer.dist.php +++ b/tools/php-cs-fixer/.php-cs-fixer.dist.php @@ -1,11 +1,13 @@ in([ - __DIR__ . '/config', - __DIR__ . '/lib', - __DIR__ . '/pages', - __DIR__ . '/tests', + $projectRoot . '/config', + $projectRoot . '/lib', + $projectRoot . '/pages', + $projectRoot . '/tests', ]) ->name('*.php');