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

[TypeDeclaration] Fix union type by multiple method calls on ParamTypeByMethodCallTypeRector #6155

Merged
merged 6 commits into from
Jul 16, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik marked this pull request as draft July 16, 2024 18:40
@samsonasik samsonasik marked this pull request as ready for review July 16, 2024 18:56
@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @benharold

@samsonasik
Copy link
Member Author

samsonasik commented Jul 16, 2024

Some service probably shared, running unit to target test class got correct result:

vendor/bin/phpunit /Users/samsonasik/www/rector-src/rules-tests/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector/ParamTypeByMethodCallTypeRectorTest.php
PHPUnit 10.5.27 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.4
Configuration: /Users/samsonasik/www/rector-src/phpunit.xml

..................                                                18 / 18 (100%)

Time: 00:00.394, Memory: 66.00 MB

OK (18 tests, 19 assertions)

Run all test got error:

2) Rector\Tests\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector\ParamTypeByMethodCallTypeRectorTest::test with data set #16 ('/Users/samsonasik/www/rector-...hp.inc')
Failed on fixture file "union_on_multiple_calls_nullable.php.inc"
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
     public function hashSet2(string $key, array $value): void {
     }
 
-    public function set(string $type, string $key, array|null|string $value): void {
+    public function set(string $type, string $key, $value): void {

I will check more ....

@samsonasik
Copy link
Member Author

I see, php version set in test is needed 379c0ce

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 8416021 into main Jul 16, 2024
34 checks passed
@samsonasik samsonasik deleted the handle-union-param-type-by-method-call-type branch July 16, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect behavior of ParamTypeByMethodCallTypeRector
1 participant