PHPDoc: Documenting a function with a variable number of arguments

前端 未结 4 1969
渐次进展
渐次进展 2021-01-07 16:57

What is the recommended method for documenting a class method that accepts a variable number of arguments?

Maybe something like this?



        
4条回答
  •  忘掉有多难
    2021-01-07 17:19

    In the case of the ... syntax, PHPStorm 2017.1 uses:

    /**
     * @param Type[] ...$values One or more values.
     */
    public function func(Type ...$values) {
        // ...
    }
    

提交回复
热议问题