phpDocumentor / fig-standards

Standards either proposed or approved by the Framework Interop Group

Home Page:http://www.php-fig.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What defines a collection?

opened this issue · comments

Hello

The section on collections in PSR-5 sounds very useful [1]. I'm wondering how one demarcates a collection? In the example, ArrayObject is used, which is an internal class in PHP, but can we also use this syntax for or own classes? If so, do we need to have some special tag in the class docblock that indicates this is possible, such as @collection or is this unnecessary?

Finally, does this syntax also apply to the built-in array construct, allowing us to use a construct such as array<int, string> or int[string] (not unlike the D programming language)?

[1] https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md#collections

Once again I should have looked better before opening a ticket: it seems there is already a PR under "generics" (I only searched for "Collection").