I tried the following,
我試着以下,
/*
* 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);
But, when I tried to use it in another place, it says PHPDoc not found.
但是,當我試着在別的地方使用它時,它說PHPDoc沒有找到。
Any Ideas on how to get this to work in NetBeans PHP?
關於如何使它在NetBeans PHP中工作有什么想法嗎?
UPDATE :
更新:
The following is the updated syntax which will work in 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) {
5 个解决方案
#1
35
You are missing an asterisk * in the first line: Try
在第一行:Try
/**
* 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
17
Additional hint : Netbeans can make it for you :
附加提示:Netbeans可以為你做到:
public static function test($var1,$var2) {
return $array;
}
Now write :
現在寫:
/**[press enter]
public static function test($var1,$var2) {
return $array;
}
Tadaam :
Tadaam:
/**
*
* @param type $var1
* @param type $var2
* @return type
*/
public static function test($var1,$var2) {
return $array;
}
#3
6
You need 2 ** on the comments opening for Netbeans to recognize it:
你需要2 **的評論開放,讓Netbeans認識它:
Should be
應該是
/**
*
*/
not just a regular comment
不僅僅是一個普通的評論
/*
*
*/
Example:
例子:
/**
* function description
*
* @param *vartype* ***param1*** *description*
* @param int param2 this is param two
* @return void
*/
Netbeans automatically adds the function name
Netbeans自動添加函數名
@return is optional but usefull
@return是可選但有用的
#4
5
I believe the way to start you function comment is
我認為函數注釋的開頭是
/**
* 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
*/
Note the double asterisk to start your comment. You might want to check this php documentor.
請注意兩個星號來開始你的評論。您可能需要檢查這個php文檔。
#5
2
/**
*
* Adds a relationship between two entities using the given relation type.
*
* @since 2.1.1
* @package coreapp
* @subpackage entity
*
* @param string $fromKey the original entity
* @param mixed $toKey the referring entity
* @param string relationTypeDesc the type of relationship
* @return bool False if value was not updated and true if value was updated.
*/
You may add since which version, what package, what subpackage, add type of parameters, i.e. string, mixed, bool, and what is the return.
您可以添加哪個版本,哪個包,哪個子包,添加類型的參數,例如字符串,混合,bool,以及返回值。
本文介绍了一种在NetBeans PHP环境中正确使用PHPDoc注释的方法,解决了因注释格式不正确导致的问题,并提供了多种修正方案。
3531

被折叠的 条评论
为什么被折叠?



