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

Len*_*ran 31 php netbeans documentation-generation code-completion

我试过以下,

/*
 * 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);
Run Code Online (Sandbox Code Playgroud)

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

替代文字

关于如何在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) {
Run Code Online (Sandbox Code Playgroud)

Pek*_*ica 40

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

/**
 * 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
 */
Run Code Online (Sandbox Code Playgroud)


小智 19

附加提示:Netbeans可以为您提供:

public static function test($var1,$var2) {
    return $array;
}
Run Code Online (Sandbox Code Playgroud)

现在写 :

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

Tadaam:

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


Pau*_*ulo 6

在Netbeans的评论开头你需要2**来识别它:

应该

/**         
 *           
 */
Run Code Online (Sandbox Code Playgroud)

不只是定期评论

/*
 *
 */
Run Code Online (Sandbox Code Playgroud)

例:

/**
 * function description
 *
 * @param *vartype* ***param1*** *description*
 * @param int param2 this is param two  
 * @return void  
 */
Run Code Online (Sandbox Code Playgroud)

Netbeans会自动添加功能名称

@return是可选的但很有用


A S*_*edo 5

我相信开始你的功能评论的方法是

/**
 * 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
 */
Run Code Online (Sandbox Code Playgroud)

请注意双星号以开始发表评论.你可能想检查一下这个php文件.