تحذير: هذا المنشور قديم وقد لا يعكس حالة الفن الحالية
التوثيق هو مفتاح أي مشروع ناجح. إليك مقدمة سريعة لما يجب توثيقه وكيف.
الطبقات
ابدأ كل فصل بـ
/**
* 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 descriptionIf your method returns something, describe the return value
* @return $thisIf your method throws an exception, describe the exception
* @throws \ExceptionCode
Code inside methods needs to be documented if needed.
Dot not document what the code is doing, document what the code should do.