Skip to content

[TypeInfo] Fix create union with nullable type #59818

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
Feb 20, 2025

Conversation

mtarld
Copy link
Contributor

@mtarld mtarld commented Feb 20, 2025

Q A
Branch? 7.2
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

Fix the creation of a union type with a nullable type, such as

Type::union(Type::nullable(Type::int()), Type::string());

// it will be handled the same as:
Type::nullable(Type::int(), Type::string())
Type::union(Type::int(), Type::string(), Type::null())

@nicolas-grekas
Copy link
Member

Thank you @mtarld.

@nicolas-grekas nicolas-grekas merged commit 33f70b7 into symfony:7.2 Feb 20, 2025
9 of 11 checks passed
@mtarld mtarld deleted the fix/union-factory-nullable-type branch February 20, 2025 12:03
mtarld pushed a commit to mtarld/symfony that referenced this pull request Feb 21, 2025
…rld)

This PR was merged into the 7.2 branch.

Discussion
----------

[TypeInfo] Fix create union with nullable type

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

Fix the creation of a union type with a nullable type, such as
```php
Type::union(Type::nullable(Type::int()), Type::string());

// it will be handled the same as:
Type::nullable(Type::int(), Type::string())
Type::union(Type::int(), Type::string(), Type::null())
```

Commits
-------

a5f779c [TypeInfo] Fix create union with nullable type
@fabpot fabpot mentioned this pull request Feb 26, 2025
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.

4 participants