Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 812 Bytes

phpdoc_order.rst

File metadata and controls

37 lines (29 loc) · 812 Bytes

Rule phpdoc_order

Annotations in PHPDoc should be ordered so that @param annotations come first, then @throws annotations, then @return annotations.

Examples

Example #1

--- Original
+++ New
 <?php
 /**
  * Hello there!
  *
- * @throws Exception|RuntimeException foo
  * @custom Test!
- * @return int  Return the number of changes.
  * @param string $foo
  * @param bool   $bar Bar
+ * @throws Exception|RuntimeException foo
+ * @return int  Return the number of changes.
  */

Rule sets

The rule is part of the following rule set:

@PhpCsFixer
Using the @PhpCsFixer rule set will enable the phpdoc_order rule.