文档:如何记录函数可以返回多种类型的变量?

Assume a PHP function like this:

/**
 * Description
 *
 * @return  Namespace\GenericObject
 */
function doSomething() {
    if ($some_parameter) {
        return new GenericObject;
    } else {
        return FALSE;
    }
}

How should the return of the function be documented, using PHPDoc standard? As far as I know, a function should only have one return documented, yet, the function above can return either a new object, or a bool.

Use the or | operator.

/**
 * Description
 *
 * @return  Namespace\GenericObject|null|array|false
 */
function doSomething() {
    if ($some_parameter) {
        return new GenericObject;
    } else {
        return FALSE;
    }
}