-
Notifications
You must be signed in to change notification settings - Fork 575
Replace FAUX function call workarounds #5769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
phpstan-bot
wants to merge
24
commits into
phpstan:2.2.x
Choose a base branch
from
phpstan-bot:create-pull-request/patch-7xy6xo5
base: 2.2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
bd43309
Add `setShouldNotImplyOppositeCase()` on `SpecifiedTypes` to replace …
VincentLanglet 8a3fc6e
Add comment explaining why shouldNotImplyOppositeCase causes early re…
phpstan-bot 673de07
Rename `shouldNotImplyOppositeCase` to `shouldNotDetermineCheckResult`
phpstan-bot 184d584
Rename `shouldNotDetermineCheckResult` to `specifyOnly`
phpstan-bot d6b3f77
Keep rootExpr for equality assertions, move specifyOnly after rootExp…
phpstan-bot 2fe0e2c
Rework
VincentLanglet 7e59a42
Remove unused specifyOnly flag, document setRootExpr
phpstan-bot 3c6a6df
Add duplicate call detection for rootExpr-based type specifying
phpstan-bot ee9d8ef
Remove duplicate array_key_exists check
phpstan-bot b4de1d8
Add setSideEffectOnly() flag on SpecifiedTypes, replace rootExpr work…
phpstan-bot 08421e8
Split bug-14705 test into PHP 7.4-compatible and PHP 8.0+ parts
phpstan-bot 8277b77
Rename sideEffectOnly to specifyOnly on SpecifiedTypes
phpstan-bot 5d8e6cd
Revert unrelated duplicate array_key_exists removal
phpstan-bot b09209c
Document setSpecifyOnly() for third-party extension migration
phpstan-bot 980c39a
Correct setSpecifyOnly() PHPDoc: clarify filterByTruthyValue scope
phpstan-bot dbec47e
Store specifyOnly boolean marker via overwrite to fix duplicate detec…
phpstan-bot b03091a
Fix specifyOnly boolean marker overwriting function return types
phpstan-bot df66dbd
Explain specifyOnly expression-statement handling in NodeScopeResolver
phpstan-bot 341f63d
Move bug-14705 test into nsrt with assertType, merge realpath elvis c…
phpstan-bot a3e940b
Rename SpecifiedTypes getter to shouldSpecifyOnly() for consistency
phpstan-bot d003b39
Add array_key_exists duplicate-in-loop assertType case to bug-14705
phpstan-bot f223e96
Explain why duplicate array_key_exists positive call stays bool
phpstan-bot 2d8b972
Strip BooleanNot when storing specifyOnly duplicate marker
phpstan-bot 7081004
Remove duplicate array_key_exists check in MethodCallWithPossiblyRena…
phpstan-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment to explain this code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I addressed the review comment by adding an explanatory comment to the
specifyOnlyblock inNodeScopeResolver.php(the expression-statement path).The comment explains:
specifyOnlyhandling inMutatingScope::filterByTruthyValue().$this->assertValid($x);with@phpstan-assert =non-empty-string $x) only narrow types as a side effect, soImpossibleCheckTypeHelperwould otherwise have no stored result to detect a duplicate call against. StoringConstantBooleanType(true)for the call makes a second identical call report as always-true.TypeSpecifier::create(): void calls aren't used for their return value, so the purity check there would drop the marker for the impure calls that need it most, and intersectingtruewith the void return type would produce*NEVER*.Verified:
make phpstanclean, the twoImpossibleCheckType*RuleTestsuites pass (111 tests). Committed separately and pushed.