Details
-
Bug
-
Status: Closed
-
Low
-
Resolution: Fixed
-
None
Description
The docs (https://docs.moodle.org/dev/Coding_style#Types) say:
- When multiple occurrences of a given "type" are used, it's highly recommended to document them as type[] instead of the simpler and less informative "array" alternative.
The definition of "multiple occurrences" is not clear enough, type[] is simply defines an array of elements of given type, (e.g. int[] or stdClass[]). I suggest to rephrase in a way:
When value represented as array of given type, it's highly recommended to document them as type[] instead of the simpler and less informative "array" alternative (e.g. int[] or stdClass[]).
While you are changing that part of wiki anyway, I think it could be useful to add the example of using pipe for multiple types:
- When multiple different types are possible, they must be separated by a vertical bar (pipe) (e.g. @return int|false)