-
Notifications
You must be signed in to change notification settings - Fork 685
Improved type of callable-array #9794
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
Improved type of callable-array #9794
Conversation
92f0e59 to
6b4f84f
Compare
|
@orklah what would be preferred here -'callable-array{0: class-string, 1: string}' As this is now a list of size 2 I'm not sure which better defines the shape. |
|
Semantically, the second syntax implies that the order is locked while the first doesn't (meaning |
6b4f84f to
aa17161
Compare
|
The callable method is always |
354a018 to
99054d4
Compare
99054d4 to
780375a
Compare
780375a to
889bdca
Compare
|
I see TCallableArray being removed but I don't see TCallableList being removed as well, did I miss something? |
robchett
left a comment
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.
TCallableList was removed upstream - remove BC note about it
|
I rebased this branch last week as it was a long way behind. Looks like TCallableList was removed elsewhere upstream. Tracked that down to cca2767, removed the note about that in the BC note |
| ) { | ||
| $callable_types[] = $type; | ||
| $redundant = false; | ||
| } elseif ($type instanceof TArray) { |
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.
Shouldn't this create a TCallableKeyedArray now that TCallableArray doesn't exists?
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.
Yes, that would make more sense and I don't remember why I made that change to begin with. It doesn't appear to effect any of the tests either way which
| !is_numeric($property_key) | ||
| || ($had_optional && !$property_maybe_undefined) | ||
| || $type === 'array' | ||
| || $type === 'callable-array' |
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.
why remove this? TCallableKeyedArray still have a callable-array key, no?
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.
I have no good reason why it was removed. Now back and tests are unaffected,
|
Thanks! |
BC: Removes TCallableArray & TCallableList in favour of TCallableKeyedArray
Closes #7778
Also improves the type of callable-array so that it is interpreted as a
list{class-string|object, string}instead ofnon-empty-array<array-key, mixed>