Does phpDocumentor tags order matter?

When we document our class, method and/or function with phpDocumentor, is there any specific order I should follow according to the standards?

I know it doesn’t matter for output the document. Since it is outputting the order what I have written.

This is for my knowledge and understanding if there is any order standards for it.

Not as such… At least, none that I can find/think of. However, docblocks commonly follow a distinct format/pattern:

/**
 * Summary
 * [optional blank line]
 * Description
 * [optional blank line]
 * @see Optional, but more documentation can be added here
 * [optional blank line]
 * @todo: Development docs here
 * [optional blank line]
 * @api indicator of expected/intended usage of code
 * @uses Use-cases of code
 * @property* property-access
 * @deprecated
 * [optional blank line]
 * @param <type> $name [ = default value]
 * @return <return type, if any>
 * @throws <ExceptionType> [optionally explain when and why]
 * @throws <ExceptionType>
 */

The logical order here is:

  • Summary
  • Description
  • Annotations documenting the code even more, examples, files, links etc…
  • Annotations that document behavior and usage of code ( (like @see)
  • Annotations regarding ungoing development
  • Annotations indicating visibility and expected usage (@api or @internal) Structural
  • Annotations indicating internals (dependencies on methods/properties) Structural
  • Annotations regarding availability (deprecation, preferably mentioning alternatives) Structural
  • Annotations regarding the function/method’s signature (@param, then @return)
  • Annotations covering unexpected behaviour (ie @throws)

Some might say that the @throws annotation should precede the @returns, seeing as the last thing a function should do is return something. It is common, though, to put the @throws in last. That, to me, makes more sense: the documentation covers the flow of the method you’re commenting. If something (an exceptional case) disrupts the flow, an exception is thrown, hence the @throws annotation shouldn’t be part of the “normal” description of the method.

Either way, the simple rule of thumb here is:

  • IDE tooltip info comes first (summary, description, @see)
  • Additional documentation
  • Development info (@todo, @example, possibly @version)
  • Structural elements (the ones that apply)
  • The expected parameters info comes next (@param)
  • The result (@return)
  • In case of errors (@throws)

Note that the annotations listed here as Structural elements require you to document the classes and properties, too: /** @var <type> */ and, perhaps include @version and @license tags, too

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật