Comment associative array in PHP Documentor

前端 未结 3 1706
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 14:08

I use several associative arrays in my PHP application and I\'m using PHP documentor to comment my sources. I never really did specify comments for the arrays in an array, b

3条回答
  •  生来不讨喜
    2020-12-01 14:30

    I would look at the WordPress Inline Documentation Reference for some hints, though it's not currently comprehensive.

    Use @param or @var or @property, whichever is appropriate in your context

    According to those guidelines, you might document your associative array like this:

    /**
     * @property array $my_array {
     *     An array of parameters that customize the way the parser works.
     *
     *     @type boolean $ignore_whitespace Whether to gobble up whitespace. Default true.
     *     @type string $error_level What the error reporting level is. Default 'none'.
     *                               Accepts 'none', 'low', 'high'.
     * }
     */
    

提交回复
热议问题