Normalize arguments before calling into TypeSpecifyingExtensions#4034
Merged
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom May 30, 2025
Merged
Normalize arguments before calling into TypeSpecifyingExtensions#4034ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
ondrejmirtes merged 2 commits intophpstan:2.1.xfrom
Conversation
staabm
commented
May 30, 2025
| return null; | ||
| } | ||
|
|
||
| // return identical object if not reordered, as TypeSpecifier relies on object identity |
Contributor
Author
There was a problem hiding this comment.
related to this comment is this line:
phpstan-src/src/Rules/Comparison/ImpossibleCheckTypeHelper.php
Lines 317 to 319 in dc8c831
without this fix the actual fix in TypeSpecifier would cause a regression:
➜ phpstan-src git:(2.1.x) ✗ vendor/bin/phpunit tests/PHPStan/Analyser/AnalyserIntegrationTest.php --filter testBug7500
PHPUnit 9.6.23 by Sebastian Bergmann and contributors.
Random Seed: 1748588377
Warning: XDEBUG_MODE=coverage (environment variable) or xdebug.mode=coverage (PHP configuration setting) has to be set
F 1 / 1 (100%)
Time: 00:46.162, Memory: 90.00 MB
There was 1 failure:
1) PHPStan\Analyser\AnalyserIntegrationTest::testBug7500
Failed asserting that actual size 1 matches expected size 0.
Emitted errors:
- Call to function ksort() with array<T of Bug7500\PositionEntityInterface&Bug7500\TgEntityInterface> will always evaluate to true
in /Users/staabm/workspace/phpstan-src/tests/PHPStan/Analyser/data/bug-7500.php on line 36
/Users/staabm/workspace/phpstan-src/src/Testing/PHPStanTestCase.php:228
/Users/staabm/workspace/phpstan-src/tests/PHPStan/Analyser/AnalyserIntegrationTest.php:921
FAILURES!
Tests: 1, Assertions: 3, Failures: 1.
Collaborator
|
This pull request has been marked as ready for review. |
Member
|
Perfect, thank you! |
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.
closes phpstan/phpstan#13088