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] Only apply false type on php 8.2+ configured on TypedPropertyFromAssignsRector #3422

Merged
merged 22 commits into from
Feb 28, 2023

Conversation

samsonasik
Copy link
Member

It currently apply false type on php <8.2, which should only apply when configured on php 8.2+ only, ref https://getrector.com/demo/2b9d1a69-3d9d-4293-8a3d-c93f47560bf0

Fixes rectorphp/rector#7809

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @koko236

@samsonasik
Copy link
Member Author

It seems cause error on pseudo false type test on union:

There was 1 failure:

1) Rector\Tests\Php80\Rector\FunctionLike\UnionTypesRector\UnionTypesRectorTest::test with data set #20
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 
 final class FalsePseudoType
 {
-    public function go($value): false|int
+    public function go($value): bool|int
     {
         return (int) $value ?? false;

which allowed on php < 8.2

@samsonasik
Copy link
Member Author

Fixed with handle on UnionTypeMapper 05f73b9

@samsonasik
Copy link
Member Author

Finally 🎉 🎉 🎉 , All checks have passed 🎉 @TomasVotruba it is ready for review.

@samsonasik
Copy link
Member Author

Rebased.

@TomasVotruba
Copy link
Member

I think there is some memory leak in paratest

@samsonasik
Copy link
Member Author

Yes, seems happened this week. I restart the build, we can back to original phpunit if it keep happening.

@samsonasik
Copy link
Member Author

Let's back to phpunit c282e62

@TomasVotruba
Copy link
Member

Feel free to merge when ready 👍

@samsonasik samsonasik merged commit 2eac878 into main Feb 28, 2023
@samsonasik samsonasik deleted the only-apply-false-type-on-php82 branch February 28, 2023 18:18
samsonasik added a commit that referenced this pull request May 8, 2023
…edPropertyFromAssignsRector (#3422)

* [TypeDeclaration] Only apply false type on php 8.2+ configured on TypedPropertyFromAssignsRector

* Fixed 🎉

* add true type fixtures

* map

* clean up comment

* Fixed with handle in UnionTypeMapper

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* fix phpstan

* Revert [ci-review] Rector Rectify

This reverts commit f765610.

* Revert [ci-review] Rector Rectify

This reverts commit e3f75ec.

* skip return type override on abstract Method Reflection

* Fix phpstan

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* skip abstract class

* Final touch: clean up with isInterface() check for detect all method are abstract

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* back to phpunit

* add back RunTestsInSeparateProcesses

* clean up fixture

---------

Co-authored-by: GitHub Action <action@github.com>
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