Skip to content

[TypeInfo] add TypeFactoryTrait::arrayKey() #60087

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
Mar 31, 2025

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Mar 30, 2025

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

reading the latest PRs about array shapes I wondered if it wouldn't be useful to have a dedicated method for the array key types supported by PHP

@xabbuh xabbuh force-pushed the type-info-array-key branch from f9308fe to 8b4d5a2 Compare March 30, 2025 12:17
Copy link
Contributor

@mtarld mtarld left a comment

Choose a reason for hiding this comment

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

Good idea! 🙂

@@ -5,7 +5,7 @@ CHANGELOG
---

* Add `Type::accepts()` method
* Add `TypeFactoryTrait::fromValue()` method
* Add the `TypeFactoryTrait::fromValue()`, `TypeFactoryTrait::arrayShape()`, and `TypeFactoryTrait::arrayKey()` methods
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can merge the accepts method as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

accepts() was documented for Type as it's not in the trait. Does that really make sense to merge them or isn't it more readable this way?

Copy link
Member

Choose a reason for hiding this comment

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

These methods are most likely to be accessed via the Type class. But we can keep them separate in the changelog.

@GromNaN
Copy link
Member

GromNaN commented Mar 31, 2025

Thank you @xabbuh.

@GromNaN GromNaN merged commit 4ca9c2d into symfony:7.3 Mar 31, 2025
5 of 11 checks passed
@xabbuh xabbuh deleted the type-info-array-key branch March 31, 2025 08:13
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.

6 participants