Skip to content
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

Fix false positive with array_combine() on php8 #2276

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Mar 7, 2023

closes phpstan/phpstan#9011

test fails without fix:

There was 1 failure:

1) PHPStan\Rules\Methods\ReturnTypeRuleTest::testBug9011
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'
+'16: Method Bug9011\HelloWorld::getX() should return array<string> but returns false.
 '

C:\dvl\Workspace\phpstan-src-staabm\src\Testing\RuleTestCase.php:154
C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\Rules\Methods\ReturnTypeRuleTest.php:851

the 2nd example posted in the issue works as expected in my eyes.

@staabm staabm changed the title Fix false positive with ? array_combine()` on php8 Fix false positive with array_combine() on php8 Mar 7, 2023
@staabm staabm marked this pull request as ready for review March 7, 2023 16:52
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@staabm staabm marked this pull request as draft March 7, 2023 16:54
@clxmstaab clxmstaab force-pushed the bug9011 branch 2 times, most recently from c2a5376 to 6299bf5 Compare March 7, 2023 16:57
@staabm staabm marked this pull request as ready for review March 7, 2023 17:07
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit 04edd04 into phpstan:1.10.x Mar 8, 2023
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the bug9011 branch March 8, 2023 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants