chore: move php-cs-fixer config into tools

- relocate .php-cs-fixer.dist.php to tools/php-cs-fixer/.php-cs-fixer.dist.php

- update composer scripts, docs, quality gates, and style skill references

- keep finder scope stable via project-root resolution

- fix pre-existing unused imports reported by php-cs-fixer
This commit is contained in:
2026-04-01 16:38:58 +02:00
parent 83b65812d0
commit 0bf7f62fd8
10 changed files with 17 additions and 19 deletions

View File

@@ -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",

View File

@@ -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.

View File

@@ -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

View File

@@ -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:

View File

@@ -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.

View File

@@ -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:

View File

@@ -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"
}
}

View File

@@ -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.<id>.*` Prefix

View File

@@ -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;

View File

@@ -1,11 +1,13 @@
<?php
$projectRoot = dirname(__DIR__, 2);
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/config',
__DIR__ . '/lib',
__DIR__ . '/pages',
__DIR__ . '/tests',
$projectRoot . '/config',
$projectRoot . '/lib',
$projectRoot . '/pages',
$projectRoot . '/tests',
])
->name('*.php');