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

Do not typehint DNF union types #1585

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Do not typehint DNF union types #1585

merged 1 commit into from
Feb 11, 2025

Conversation

scyzoryck
Copy link
Collaborator

Q A
Bug fix? yes
New feature? no
Doc updated no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #1584
License MIT

Tests coverage based on: https://wiki.php.net/rfc/dnf_types

@goetas I need your opinion on that:

  1. Current implementation skips any cases of Disjunctive Normal Form Types.
  2. Alternative solution would be to skip only Intersection types, so (A&B)|D could be resolved into D, when (A&B)|C|D into union<C,D>

Looking at the use cases like ArrayCollections from Doctrine I guess second option might be more intuitive for users, when first safer as it brings back behavior from prev lib versions. 🤔

@goetas
Copy link
Collaborator

goetas commented Feb 10, 2025

I'm fine with not supporting such expressions.

I really hope no one uses them! :D

@scyzoryck scyzoryck merged commit 033c9be into master Feb 11, 2025
19 of 20 checks passed
@scyzoryck scyzoryck added the Union Types Support for Union Types label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Union Types Support for Union Types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants