Currently and from a strictly technical point of view, all annotations can appear multiple times on an item. That being said, it is wrong from a practical standpoint. Some annotations should not appear several times, for instance @type on variables, or @return on functions, only to name a few.
@FWeinb suggests we add a multiple boolean option on each annotation. This way, annotations would not always be arrays. They would be arrays if they allow multiple occurrences (i.e. multiple: true), else it would be a standalone value.
This would solve issue like:
{% if item.return %}
{{ return[0].type }} {{ return[0].description }}
{% endif %}
... which is ugly as fuck.
This would trigger breaking changes, so it's either 2.0, or never (well, 3.0...).
Edit: this will lead to a new terminology "collection annotations" and "single annotations". I like it.
Currently and from a strictly technical point of view, all annotations can appear multiple times on an item. That being said, it is wrong from a practical standpoint. Some annotations should not appear several times, for instance
@typeon variables, or@returnon functions, only to name a few.@FWeinb suggests we add a
multipleboolean option on each annotation. This way, annotations would not always be arrays. They would be arrays if they allow multiple occurrences (i.e.multiple: true), else it would be a standalone value.This would solve issue like:
{% if item.return %} {{ return[0].type }} {{ return[0].description }} {% endif %}... which is ugly as fuck.
This would trigger breaking changes, so it's either 2.0, or never (well, 3.0...).
Edit: this will lead to a new terminology "collection annotations" and "single annotations". I like it.