PHPdoc @param中的两个或多个数据类型

好的,我有这个PHPdoc上面的我的类方法
/**
 * this a function that translates the text
 * @param string|boolean $lang if string the string given in the parameter will be the language code that will represent the language desired,if true,this will translate based on the website's current language,if false will not translate.
 */

现在我的问题是,我如何定义可以接受字符串和布尔值的$lang的数据类型.

在其他文档中,我看到混合,但它没有正确地反映在我的Eclipse IDE与PDT.

我的问题是如何显示一个@param可以接受两种或更多类型的数据类型的标准方法是什么.

注意:我给出的PHPdoc是我现在正在工作的应用程序的现有文档.那么我被分配好记录一切.

你做的正确 PHPDoc reference给出了这两个可以是多种数据类型(重点在于我)的参数选项.

The datatype should be a valid PHP type (int,string,bool,etc),a
class name for the type of object,or simply “mixed”. Further,you can
list multiple datatypes for a single parameter by delimiting them with
the pipe (e.g. “@param int|string $p1”).

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...