From dcea58df2c757f2cae48529aa620526cc13b8a6f Mon Sep 17 00:00:00 2001 From: Aaron Ware Date: Sun, 2 Aug 2026 19:17:01 -0400 Subject: [PATCH] fix(NO-TASK): Replace PSR2R namespace sniffs removed upstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit composer.json requires fig-r/psr2r-sniffer ^2.0.0, but the Linchpin ruleset still referenced PSR2R.Namespaces.UnusedUseStatement and PSR2R.Namespaces.UseInAlphabeticalOrder. psr2r 2.x deleted both in favour of Slevomat's implementations, leaving NoInlineFullyQualifiedClassName as the only sniff in that category. phpcs treats an unresolvable rule ref as a hard error, so the whole standard failed to load: ERROR: Referenced sniff "PSR2R.Namespaces.UnusedUseStatement" does not exist Consumers could not work around it either — phpcs resolves refs before applying , so excluding the dead sniffs in a project's phpcs.xml.dist still aborts. Linchpin-Minimum never referenced them, which is why linchpin-blocks was unaffected. Swapped both to their Slevomat equivalents. slevomat/coding-standard is a hard dependency of psr2r-sniffer 2.x, so it is always installed alongside it. UnusedUses is configured with searchAnnotations so an import referenced only from a @param/@return/@var docblock still counts as used — without it the sniff tells you to delete imports that PHPStan then reports as unresolvable types. Note for consumers: mantle's composer.json says 1.1.8 while its composer.lock still pins v1.1.6 with psr2r 0.6.4, where the old sniffs exist. Its phpcs run works today and breaks the moment that lock is refreshed, so this wants releasing before any repo on the full Linchpin ruleset updates. Co-Authored-By: Claude Opus 5 (1M context) --- Linchpin/ruleset.xml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Linchpin/ruleset.xml b/Linchpin/ruleset.xml index 4c7fb9a..7e8e785 100644 --- a/Linchpin/ruleset.xml +++ b/Linchpin/ruleset.xml @@ -162,8 +162,32 @@ - - + + + + + + + +