如何使用phpDocumentor在PHP 5中记录类属性 [英] How to document class properties in PHP 5 with phpDocumentor

查看:93
本文介绍了如何使用phpDocumentor在PHP 5中记录类属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请考虑以下PHP 5类:

Take in consideration the following PHP 5 class:

class SomeClass
{
    //I want to document this property...
    private $foo;


    function __construct()
    {

    }

    public function SetFoo($value)
    {
        $this->foo = $value;
    }

    public function GetFoo()
    {
        return $this->foo;
    }
}

如何在 phpDocumentor 中记录$ foo属性?我什至不确定它是否需要记录在案,但我想知道是否需要...

How in phpDocumentor will I document the $foo property? I'm not even sure it need to be documented but I would like to know how if if needs to...

我知道如何记录SetFoo()和GetFoo(),我只是不确定私有属性(变量?).

I know how to document SetFoo() and GetFoo(), I'm just not sure about the private property (variable?).

谢谢!

推荐答案

/**
 * This is what the variable does. The var line contains the type stored in this variable.
 * @var string
 */
private $foo;

这篇关于如何使用phpDocumentor在PHP 5中记录类属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆