如何在 Netbeans PHP 中为我的函数添加文档?

我尝试了以下方法,

/*
 * addRelationship
 *
 * Adds a relationship between two entities using the given relation type.
 *
 * @param fromKey the original entity
 * @param toKey the referring entity
 * @param relationTypeDesc the type of relationship
 */

function addRelationship($fromKey, $toKey, $relationTypeDesc) {
    $relationTypeKey = $this->getRelationTypeKey($relationTypeDesc);

但是,当我试图在另一个地方使用它时,它说PHPDoc没有找到。

alt text

关于如何让它在NetBeans PHP中工作的任何想法?

更新:

以下是在 NetBeans PHP 中可用的更新语法 -

/** 
 * addRelationship
 *
 * Adds a relationship between two entities using the given relation type.
 *
 * @param integer $fromKey the original entity
 * @param integet $toKey the referring entity
 * @param string $relationTypeDesc the type of relationship
 */

function addRelationship($fromKey, $toKey, $relationTypeDesc) {

答案 1

第一行中缺少一个星号:尝试*

/**
 * addRelationship
 *
 * Adds a relationship between two entities using the given relation type.
 *
 * @param fromKey the original entity
 * @param toKey the referring entity
 * @param relationTypeDesc the type of relationship
 */

答案 2

附加提示:Netbeans可以为您制作:

public static function test($var1,$var2) {
    return $array;
}

现在写:

/**[press enter]
public static function test($var1,$var2) {
    return $array;
}

多田岩 :

/**
 * 
 * @param type $var1
 * @param type $var2
 * @return type
 */
public static function test($var1,$var2) {
    return $array;
}

推荐