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] Handle union A extends B on ReturnUnionTypeRector #5149

Merged
merged 4 commits into from Oct 9, 2023

Conversation

samsonasik
Copy link
Member

Cherry picked from PR:

due to clean up manual check on UnionTypeMapper, that I found a bug on it.

@samsonasik
Copy link
Member Author

It seems cause a bug on AddMethodCallBasedStrictParamTypeRector

There were 2 failures:

1) Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector\UnionTest::test with data set #1
Failed on fixture file "narrow_union.php.inc"
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
         $this->someExpr($string);
     }
 
-    private function someExpr(\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Scalar\String_ $expr)
+    private function someExpr(\PhpParser\Node\Expr $expr)

I will check more.

@samsonasik
Copy link
Member Author

Fixed 🎉

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@TomasVotruba
Copy link
Member

Looks good to me, thanks 👍

@TomasVotruba TomasVotruba merged commit ea3c504 into main Oct 9, 2023
41 checks passed
@TomasVotruba TomasVotruba deleted the union-a-extends-b branch October 9, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants