Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[VarDumper] Support for intersection types #42099

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

Merged
merged 1 commit into from
Jul 15, 2021

Conversation

derrabus
Copy link
Member

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets #41552
License MIT
Doc PR N/A

Signed-off-by: Alexander M. Turek <me@derrabus.de>
@derrabus derrabus force-pushed the bugfix/vd-intersection-types branch from bbe8260 to 3cf1057 Compare July 14, 2021 14:07
Comment on lines +326 to +337
types: array:2 [
0 => ReflectionNamedType {
name: "Traversable"
allowsNull: false
isBuiltin: false
}
1 => ReflectionNamedType {
name: "Countable"
allowsNull: false
isBuiltin: false
}
]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to match the generated output for ReflectionUnionType here. This is a bit verbose though because the sub-types of an intersection are guaranteed to be a ReflectionNamedType with $allowsNull === false and $isBuiltin === false.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, nullable intersection types are possible, see https://3v4l.org/aURFN/rfc#vgit.master

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh well. It's not like I haven't told them. 🤷🏻 php/php-src#6799 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loophole was closed. php/php-src#7254

@nicolas-grekas
Copy link
Member

Thank you @derrabus.

@nicolas-grekas nicolas-grekas merged commit b1fbd1b into symfony:4.4 Jul 15, 2021
@derrabus derrabus deleted the bugfix/vd-intersection-types branch July 15, 2021 08:42
This was referenced Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.