-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
f9308fe
to
8b4d5a2
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.
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 |
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.
Maybe we can merge the accepts
method as well?
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.
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?
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.
These methods are most likely to be accessed via the Type
class. But we can keep them separate in the changelog.
Thank you @xabbuh. |
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