@@ -960,9 +960,9 @@ Each Constant or Property definition or Variable where the type is ambiguous
960960or unknown SHOULD be preceded by a DocBlock containing the @var tag. Any
961961other variable MAY be preceded with a DocBlock containing the @var tag.
962962
963- The @var tag SHOULD contain the name of the element it documents. An exception
964- to this is when property declarations only refer to a single property. In this
965- case the name of the property MAY be omitted.
963+ The @var tag MUST contain the name of the element it documents, unless this
964+ property declaration only refers to a single property. In this case the name of
965+ the property MAY be omitted.
966966
967967` element_name ` is used when compound statements are used to define a series of Constants
968968or Properties. Such a compound statement can only have one DocBlock while several
@@ -1000,15 +1000,28 @@ Another example is to document the variable in a foreach explicitly; many IDEs
10001000use this information to help you with auto-completion:
10011001
10021002``` php
1003- /* @var \Sqlite3 $sqlite */
1003+ /** @var \Sqlite3 $sqlite */
10041004foreach ($connections as $sqlite) {
10051005 // there should be no docblock here
10061006 $sqlite->open('/my/database/path');
10071007 <...>
10081008}
10091009```
10101010
1011- Even compound statements may be documented:
1011+ Even compound statements may be documented... these two property blocks are
1012+ equivalent:
1013+
1014+ ``` php
1015+ class Foo
1016+ {
1017+ /**
1018+ * @var string $name Should contain a description
1019+ * @var string $description Should contain a description
1020+ */
1021+ protected $name, $description;
1022+
1023+ }
1024+ ```
10121025
10131026``` php
10141027class Foo
0 commit comments