Skip to content

Commit 4fd83b2

Browse files
committed
slight adjustments in var tag
1 parent 969385c commit 4fd83b2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

proposed/phpdoc-tags.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ Each Constant or Property definition or Variable where the type is ambiguous
960960
or unknown SHOULD be preceded by a DocBlock containing the @var tag. Any
961961
other variable MAY be preceded with a DocBlock containing the @var tag.
962962

963-
The @var tag MUST contain the name of the element it documents. An exception
963+
The @var tag SHOULD contain the name of the element it documents. An exception
964964
to this is when property declarations only refer to a single property. In this
965965
case the name of the property MAY be omitted.
966966

@@ -983,7 +983,9 @@ Or:
983983
```php
984984
class Foo
985985
{
986-
/** @var string|null Should contain a description */
986+
/**
987+
* @var string|null Should contain a description
988+
*/
987989
protected $description = null;
988990

989991
public function setDescription($description)
@@ -998,7 +1000,7 @@ Another example is to document the variable in a foreach explicitly; many IDEs
9981000
use this information to help you with auto-completion:
9991001

10001002
```php
1001-
/** @var \Sqlite3 $sqlite */
1003+
/* @var \Sqlite3 $sqlite */
10021004
foreach ($connections as $sqlite) {
10031005
// there should be no docblock here
10041006
$sqlite->open('/my/database/path');

0 commit comments

Comments
 (0)