如何在 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。
关于如何让它在 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) {
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.
Any Ideas on how to get this to work in NetBeans PHP?
UPDATE :
The following is the updated syntax which will work in 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) {
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您在第一行中缺少星号
*
:尝试You are missing an asterisk
*
in the first line: Try附加提示:
Netbeans 可以为您做到:
现在写:
Tadaam:
Additional hint :
Netbeans can make it for you :
Now write :
Tadaam :
您需要在注释上加上 2 ** 才能让 Netbeans 识别它:
不应该
只是常规注释
示例:
Netbeans 自动添加函数名称
@return 是可选的,但很有用
You need 2 ** on the comments opening for Netbeans to recognize it:
Should be
not just a regular comment
Example:
Netbeans automatically adds the function name
@return is optional but usefull
我相信开始您的功能评论的方法是
注意双星号来开始您的评论。
您可能需要检查这个 php 文档。
I believe the way to start you function comment is
Note the double asterisk to start your comment.
You might want to check this php documentor.
你可以添加从哪个版本,什么包,什么子包,添加参数类型,即string,mixed,bool,以及返回什么。
You may add since which version, what package, what subpackage, add type of parameters, i.e. string, mixed, bool, and what is the return.