-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[VarDumper] Adds support for ReflectionUnionType to VarDumper #40453
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
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Looking at ci It makes sense tests would break using php < 8. I'm not quite sure the best way to add this without breaking and I don't have multiple php versions running at the moment. I'm happy to take and suggestions about how to test this feature without breaking php < 8. Two possibilities I can think of are multiple classes or a single class with a conditional as below, either used in conjunction with the @require php8 annotation. I'm not sure if the parser lints a file on include, if that is the case I have no idea how to resolve this. ReflectionPropertyFixture.php
|
src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php
Outdated
Show resolved
Hide resolved
Thank you for working on this bugfix.
Your pull request targets 5.x right now which is probably mot what you wanted. If you can reproduce the crash on 4.4 as well (and I’m pretty sure that this is the case), then we should target 4.4 instead.
❤️ |
60f82a0
to
2cf92fc
Compare
@derrabus I've rebased onto 4.4 and resolved the php7 issues as suggested. CI is stuck due to a perceived conflict before I switched the target branch of the PR so I am unable to verify it is passing. Please let me know if there are any further issues, and thanks again. |
ab4cd83
to
8a0bdee
Compare
d3e73af
to
8692abd
Compare
39d4b45
to
bb79b64
Compare
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.
LGTM with minor comments, thanks.
src/Symfony/Component/VarDumper/Tests/Fixtures/ExtendsReflectionTypeFixture.php
Outdated
Show resolved
src/Symfony/Component/VarDumper/Tests/Fixtures/ExtendsReflectionTypeFixture.php
Outdated
Show resolved
Hide resolved
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.
👍🏻 (after Nicolas' comments have been addressed)
bb79b64
to
6dc7cac
Compare
6dc7cac
to
ccbf5d3
Compare
src/Symfony/Component/VarDumper/Tests/Fixtures/ExtendsReflectionTypeFixture.php
Outdated
Show resolved
Hide resolved
46bd481
to
1a11491
Compare
Thank you @michaeldnelson. |
Fixes a bug with VarDumper when dumping a ReflectionUnionType.
Notes:
I'm not sure if this was left for BC reasons but it seems like a bug if the dumper is leaving trailing spaces.
This commit fixes a crash when dumping ReflectionUnionType. The code is minimal but uses a few extra lines to preserve key order for bc and consistency. Additionally, there is an else condition that is currently unreachable but is defensive should they add additional subtypes of ReflectionType. Tests are included. Please let me know if you have any questions or suggestions. Thanks for Symfony it's a wonderful project.