正確記錄PHP代碼

警告:此帖子已過時,可能無法反映當前的最新狀態

文檔是任何成功項目的關鍵。這是您應該記錄什麼以及如何記錄的快速介紹。

班級

從每堂課開始

/**
 * Class description
 *
 * @author  Your organization or personal name
 * @license MIT (or other licence)
 */

Properties

Document every property with

/**
 * Property brief description
 *
 * @var type
 */

Methods

Document every method with

/**
 * Method brief description
 *
 * Method longer description and help
 */

If you method accepts parameters, add them

 * @param  type $param1 The param1 description
 * @param  type $param2 The param2 description

If your method returns something, describe the return value

 * @return $this

If your method throws an exception, describe the exception

 * @throws \Exception

Code

Code inside methods needs to be documented if needed.

Dot not document what the code is doing, document what the code should do.