Fix unmatched PHPStan ignore on ext-mongodb 1.x - #3555
Merged
GromNaN merged 1 commit intoJul 28, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a PHPStan failure in the PHP/8.4 Driver/1 static-analysis job by removing an inline unmatched @phpstan-ignore and instead configuring a conditional ignore in phpstan.neon.dist that won’t error when unmatched on ext-mongodb 1.x.
Changes:
- Removed the inline
@phpstan-ignore arguments.counton thegetPrefix()call inMongoDBServiceProvider. - Added a PHPStan
ignoreErrorsentry forarguments.countscoped tosrc/MongoDBServiceProvider.phpwithreportUnmatched: falseto avoid failures when the error is not emitted (driver 1.x).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/MongoDBServiceProvider.php | Removes the inline @phpstan-ignore to prevent unmatched-ignore failures on driver 1.x. |
| phpstan.neon.dist | Adds a config-based ignore for arguments.count with reportUnmatched: false to keep analysis green across driver versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The inline @PHPStan-Ignore arguments.count on MongoDBServiceProvider is reported as unmatched by PHPStan on the PHP/8.4 Driver/1 matrix job, because ext-mongodb 1.x does not trigger the underlying arguments.count error. Move the ignore to phpstan.neon.dist with reportUnmatched: false so it silently applies when relevant and does not fail the build otherwise.
GromNaN
force-pushed
the
fix/phpstan-unmatched-ignore-driver1
branch
from
July 27, 2026 16:42
51590ce to
5b7381c
Compare
GromNaN
enabled auto-merge (squash)
July 27, 2026 17:02
kevinAlbs
approved these changes
Jul 28, 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.
The
PHP/8.4 Driver/1static-analysis job fails with:The inline
@phpstan-ignore arguments.countadded in #3529 for thegetPrefix()call is unmatched when analysing againstext-mongodb 1.x, because the type resolution differs fromext-mongodb 2.xand PHPStan does not emit the underlyingarguments.counterror there.Move the ignore to
phpstan.neon.distwithreportUnmatched: falseso it silently applies on driver 2 without failing on driver 1.Reproduced locally with PHP 8.4 and
ext-mongodb 1.21.5; PHPStan now reports[OK] No errorson both driver flavors.