When you use foreach ( $a as $e ), when $a is an 'iterator of x', then type of $e is set to 'x'.
This patch add a syntax in @param and @return to specifiy that $a is an 'array of x`: @param x[].
This patch add support when $a is an 'array of x'.
pprkut |
When you use foreach ( $a as $e ), when $a is an 'iterator of x', then type of $e is set to 'x'.
This patch add a syntax in @param and @return to specifiy that $a is an 'array of x`: @param x[].
This patch add support when $a is an 'array of x'.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Conceptually, this looks fine. However, like this we end up with two different descriptions of "Array of" types in the navigation popups.
While this shows integer arrays as int[], for variadics it will show array of (int). I think at the very least both should be displayed the same.
In the end I think the simplest solution here might just be moving variadics from IndexedContainer to ArrayType (I didn't know about ArrayType back when I added support for variadics), as IndexedContainer seems a bit overkill for what PHP supports.
Could you perhaps have a look at that?
Hi! Sorry, I was just really busy and didn't have time to take a closer look.
I was a bit unsure about the different handling for normal arrays and variadics, but after thinking about it for a bit that's probably good that way. Either way it's something we could revisit at a later point, so this is good to go :)
Do you have commit access to the repo or should I push it for you?
Sorry this took so long! I have it ready to merge, just need to know the email you'd like me to use for the commit author