Repository navigation
Fix PHPStan errors and run phpcs and PHPStan in CI - #130
Merged
Merged
Conversation
- MailchimpService: Guzzle 7's ClientException::getResponse() never returns null, so the `$response ? ... : $e->getMessage()` fallbacks were dead code. PHPStan reported the third copy as an error and the other two were hidden in the baseline. Remove all three and the baseline entry. - Add a PHP lint job to php-tests.yml running `composer lint` (phpcs, then PHPStan), so pull requests, pushes to master and releases fail on new errors. - Document `composer lint` in the readme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BL2bFrTk84JMy3CPAsCTV9
conatus
commented
Oct 17, 2026
conatus
left a comment
Member
Author
There was a problem hiding this comment.
This seems good, but I am concerned that if this code was added, then it was needed, so double check in, writing some scrap code to make sure it is right if you need to.
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.
What
master(3 reported, all inMailchimpService). Guzzle 7'sClientException::getResponse()is declared to always return a response, never null, and the installed 7.15.5 confirms it. So the$e->getResponse() ? … : $e->getMessage()fallbacks, and the$response &&check, were dead code. Two copies were already being hidden by an entry inphpstan-baseline.neon. All three are removed, along with that baseline entry; nothing new is added to the baseline. Behaviour is unchanged: the fallback branch could never run.PHP lintjob tophp-tests.ymlthat runs the repo's existingcomposer lint, i.e. phpcs and then PHPStan (level 5). It runs on pull requests and pushes tomaster. The release workflow reuses this file, so lint errors also block a release. phpcs is configured to fail only on errors, not warnings (ignore_warnings_on_exit), and has no errors today.composer lint, and says to fix new PHPStan errors rather than add them to the baseline.Checks
composer lint: passes on a clean checkout of this branch. Putting the dead fallback back makes it fail ("Ternary operator condition is always true", exit 1).OK (205 tests, 333 assertions).Companion PR for frontend formatting: #129. The two may conflict in the readme's Testing section; whichever merges second will need a quick merge.
Generated by Claude Code