32

我尝试了以下,

/*
 * 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。

替代文字

关于如何让它在 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) {
4

5 回答 5

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
 */
于 2010-12-05T20:14:27.583 回答
20

附加提示: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;
}
于 2014-11-14T10:21:20.373 回答
6

您需要 2 ** 在评论中打开 Netbeans 才能识别它:

应该

/**         
 *           
 */

不只是普通评论

/*
 *
 */

例子:

/**
 * function description
 *
 * @param *vartype* ***param1*** *description*
 * @param int param2 this is param two  
 * @return void  
 */

Netbeans 自动添加函数名

@return 是可选的,但很有用

于 2012-11-07T01:02:33.580 回答
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
 */

请注意双星号以开始您的评论。您可能想查看这个php 文档

于 2010-12-05T20:17:02.320 回答
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.
 */

你可以添加从哪个版本,什么包,什么子包,添加参数类型,即字符串,混合,布尔,以及返回什么。

于 2013-04-23T03:05:39.777 回答