mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-09-27 20:02:01 +02:00
PHP-CS-Fixer's `no_unused_imports` is conservative — it treats a class name that merely appears in a PHPDoc *description* as "used", so genuinely-dead imports (e.g. `use ...Request;` next to a "Request IP" doc description) were never flagged. Slevomat's UnusedUses is precise: it parses annotation *types* (@param/@return/@var), so it keeps docblock-typed imports but removes truly unused ones — matching what Intelephense (P1003) reports. - Swap require-dev: friendsofphp/php-cs-fixer -> squizlabs/php_codesniffer + slevomat/coding-standard (+ phpcodesniffer-composer-installer, allow-listed). - New narrow ruleset build/phpcs.xml.dist (import/namespace hygiene only, NOT full PSR-12): UnusedUses (searchAnnotations=true), UseFromSameNamespace, UseDoesNotStartWithBackslash, AlphabeticallySortedUses, UseSpacing, NamespaceSpacing. View templates stay excluded. - Makefile: `make cs` -> phpcs, `make cs-fix` -> phpcbf (same target names). - CI code-style job, CLAUDE.md, CONTRIBUTING.md, docs, .gitignore updated; build/.php-cs-fixer.dist.php removed. Committed vendor stays production-only.