-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Handle PHP 8.1 types in proxies #949
Conversation
3176eac
to
603ba0d
Compare
603ba0d
to
0f5aafd
Compare
@@ -121,6 +121,8 @@ public function testDisablesOutput() | |||
* @param array<string, int> $expected | |||
* | |||
* @dataProvider provideAttributesCases | |||
* | |||
* @requires PHP < 8.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow PHP 8.1 changed return order of stuff that Debug
is returning. Given Debug
is deprecated I'm not going to invest time in fixing its tests for newer PHP versions.
For the record, test fails with:
1) Doctrine\Tests\Common\Util\DebugTest::testExportParentAttributes with data set "different-attributes" (Doctrine\Tests\Common\Util\TestAsset\ChildClass Object (...), array(4, 5, 6, 1, 2, 3))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
'(
+ [childPublicAttribute] => 4
+ [childProtectedAttribute:protected] => 5
+ [childPrivateAttribute:Doctrine\Tests\Common\Util\TestAsset\ChildClass:private] => 6
[parentPublicAttribute] => 1
[parentProtectedAttribute:protected] => 2
[parentPrivateAttribute:Doctrine\Tests\Common\Util\TestAsset\ParentClass:private] => 3
- [childPublicAttribute] => 4
- [childProtectedAttribute:protected] => 5
- [childPrivateAttribute:Doctrine\Tests\Common\Util\TestAsset\ChildClass:private] => 6
)
'
/home/runner/work/common/common/tests/Doctrine/Tests/Common/Util/DebugTest.php:133
2) Doctrine\Tests\Common\Util\DebugTest::testExportParentAttributes with data set "same-attributes" (Doctrine\Tests\Common\Util\TestAsset\ChildWithSameAttributesClass Object (...), array(4, 5, 6, 3))
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
'(
[parentPublicAttribute] => 4
[parentProtectedAttribute:protected] => 5
+ [parentPrivateAttribute:Doctrine\Tests\Common\Util\TestAsset\ChildWithSameAttributesClass:private] => 6
[parentPrivateAttribute:Doctrine\Tests\Common\Util\TestAsset\ParentClass:private] => 3
- [parentPrivateAttribute:Doctrine\Tests\Common\Util\TestAsset\ChildWithSameAttributesClass:private] => 6
)
'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP 8.1 changed the order in which class memebers appear if an object is cast to an array.
This allows using
never
and intersection types in proxied classes. Fixes #948