How to hint array of objects with phpdoc?
Hi,
is there a way to document an array of objects of a certain class?
e.g. @param $foo Someclass[] Array of objects of type Someclass
I tried various things but couldn't get anything definitive working and somehow phpdoc itself seems sparse on it too.
thx
请先登录再写评论。
You must use correct order of elements:
Thanks, this works. And now I've the next problem. I'm providing a magic __call() and thus don't have documentation und must use @method . I'm failing to understand how can provide hinting for array of classes as a parameter for a magic method. The following does not work for me:
I get a red underwaved marker here:
The marker says: "Expected: variable"
TBH -- I do not know.
I suggest just using normal array there -- should be no difference when using for code completion.
In any case: feel free to submit new ticket to the Issue Tracker describing your issue -- devs will tell for sure if this is an expected behaviour or it is a bug.