fix(LINCHPIN-5617): Drop the deprecated CallTimePassByReference sniff from Linchpin-Minimum - #52
Merged
Merged
Conversation
… from Linchpin-Minimum PHPCS deprecated Generic.Functions.CallTimePassByReference in 3.12.1, and referencing a deprecated sniff makes it print a banner to stdout ahead of the report. That leaves the JSON report unparseable, so Linchpin\Composer\Actions::phpcs_report() decodes null and check-branch-cs exits 1 with "PHPCS produced no parseable report." on every run, whether or not the diff has violations — breaking the pre-commit hook and the CI step for every repo on Linchpin-Minimum. The full Linchpin ruleset has excluded this sniff for a while; Linchpin-Minimum never got the same treatment. Nothing is lost by dropping it: call-time pass-by-reference has been a fatal error since PHP 5.4 and this package requires PHP 8.0 or later, so there is no replacement sniff to reference. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
aaronware
commented
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ClickUp: LINCHPIN-5617
Problem
Linchpin-MinimumreferencedGeneric.Functions.CallTimePassByReference, which PHPCS deprecated in 3.12.1 and removes in 4.0.0. Referencing a deprecated sniff makes PHPCS print a banner to stdout, ahead of the report payload:Actions::phpcs_report()redirects stderr (2>/dev/null), which doesn't help — the banner is on stdout.json_decode()returnsnullandrun()fails closed with:…exiting 1 on every run, violations or not. That breaks the
check-staged-cspre-commit hook and thecheck-branch-csstep inphp-checks.ymlfor every repo on Linchpin-Minimum. Consumers have been working around it with a local<exclude>; those can come out once this ships.The full
Linchpinruleset has excluded this sniff for a while —Linchpin-Minimumnever got the same treatment.Fix
Drop the rule reference. Nothing is lost: call-time pass-by-reference has been a fatal error since PHP 5.4, and this package requires PHP 8.0+. A comment is left in its place so it doesn't get re-added.
Verification
Before:
After — JSON and nothing else,
json_decode()returns an array withfiles:Also ran the CI checks locally against the changed file:
xmllint --schema vendor/squizlabs/php_codesniffer/phpcs.xsdvalidates, and the XML code-stylediff(withXMLLINT_INDENTset to a tab, as CI sets it) is clean for both rulesets.Not fixed here
Two things surfaced while verifying this, both pre-existing on
mainand both filed separately rather than bundled in:Linchpin-Minimumsets notestVersion, so PHPCompatibility 2.1.8 aborts checking of every file on PHP 8.4+ — the standard then reports only anInternal.Exceptionon line 1 and silently misses real findings (eval( $_GET[...] )included).Linchpin/ruleset.xmlsetstestVersion8.2-8.4; Minimum does not. This is the more serious half of the same broken gate.php-parallel-lint/php-parallel-lintandphp-console-highlighterare required incomposer.jsonbut are in neitherpackagesnorpackages-devincomposer.lock.composer validate --no-check-all --strictflags this locally (Composer 2.10.3); CI's Composer does not, so this job is green despite it.🤖 Generated with Claude Code