Add collection syntax support for iterable#80
Conversation
04b1017 to
b14efa6
Compare
|
Thanks for your contribution. Could you please explain why you want to have this syntax? This is a bc break would a new type help to solve the problem you are facing? |
|
I need this syntax to be able to document /**
* @var array|Collection
*/
private $items;I prefer this: /**
* @var iterable
*/
private $items;Then I add the item type to improve static analysis with e.g. PHPStan: /**
* @var iterable<SomeEntity>
*/
private $items;Though this currently fails on a project that relies on this library to fetch properties metadata because the library throws an exception when trying to parse the expression. Which part of these changes do you consider a BC break? |
|
I must have missed the default failback of the mixed type while reviewing this. Thanks this looks good. I will merge this one. |
|
Thank you :) |
This PR adds support for parsing
iterableusing the collection syntax such asiterable<int,string>.