Skip to content

Commit d828717

Browse files
authored
Update DOCBLOCKS.md
1 parent c0a528e commit d828717

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

DOCBLOCKS.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
1. Follows the [PSR-5](http://j.mp/psr-5) (draft) pattern.
66

7-
2. Types, parameters and descriptions should all be _vertically_ aligned.
8-
9-
3. Data types (if they are classes) can either be fully-qualified, or can match a valid namespace alias.
10-
11-
4. Native types should use the full name (e.g., `integer`, `string`, `boolean`).
7+
1. Data types (if they are classes) can either be fully-qualified, or can match a valid namespace alias.
128

139
```php
1410
/**
@@ -25,21 +21,11 @@ public static function getSomeKindOfData($string, SimpleXMLElement $xml) {
2521
}
2622
```
2723

28-
## Properties
29-
30-
You can choose to annotate the properties with only the data type.
31-
32-
```php
33-
/** @var integer */
34-
protected $count = 0;
35-
36-
/** @var string[] */
37-
private $array_of_strings = [];
38-
```
39-
4024
## `return`
4125

42-
Type-hinting all `return` statements can enable better auto-complete functionality in non-IDE editors (e.g., Textmate, Sublime Text, Komodo). Type hinting here is the same as for properties, except that the type must be fully-qualified.
26+
Leveraging return types (PHP 7.0+) is the preferred approach for informing IDEs about which classes we're working with.
27+
28+
Old-style annotations (below) are only acceptable for PHP 5.x codebases.
4329

4430
```php
4531
/** @var \Symfony\Components\EventDispatcher\EventDispatcher */

0 commit comments

Comments
 (0)