Repository navigation
Split containOptions() into two bool-returning checks - #534
Merged
Merged
Conversation
Conditional @phpstan-assert-if-true/-if-false tags require a bool return type (assert.nonBool, checkAssertTagsCompatibility in bleeding edge since phpstan/phpstan-src 61027562a). containOptions() returned ?bool, and its -if-false assertion would also apply to the null it returns for entries that are neither form. Amp-Thread-ID: https://ampcode.com/threads/T-01a19770-5331-74b2-963f-e324ae0f7635
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 Extension tests in phpstan/phpstan fail for phpstan-symfony since PHAR ef67a9f: https://github.com/phpstan/phpstan/actions/runs/47090047476.
phpstan-src 61027562a added the requirement that conditional asserts have a
boolreturn type, checked under bleedingEdge'scheckAssertTagsCompatibility. This repository includes bleedingEdge.containOptions()returned?bool, so its-if-falseassertion would also apply to thenullreturned for entries in neither form. This PR replaces it withisMessageWithOptions()andisMessageWithoutOptions(). Both returnbooland each keeps only the-if-trueasserts of its branch.guessHandledMessages()yields exactly what it did before.Verified locally:
vendor/bin/phpstan analyse -c phpstan.neonwith the phpstan/phpstan ef67a9f PHAR reports no errors; before this change it reported the 2 errors above.tests/Type/Symfonypasses (396 tests).