Skip to content

Commit 1f3249b

Browse files
committed
rewording / restyling
1 parent 0d7557f commit 1f3249b

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

proposed/phpdoc.md

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,10 @@ A Type has the following [ABNF][RFC5234] definition:
364364

365365
When a "Type" is used, the user will expect a value, or set of values, as detailed below.
366366

367-
When the "Type" consists of multiple types, then these MUST be separated with either
368-
the vertical bar sign (|) for union type or the ampersand (&) for intersection type.
369-
Any interpreter supporting this specification MUST recognize this and split the "Type" before evaluating.
367+
When the "Type" consists of multiple types, then these MUST be separated with
368+
either the vertical bar (|) for union type or the ampersand (&) for intersection
369+
type. Any interpreter supporting this specification MUST recognize this and
370+
split the "Type" before evaluating.
370371

371372
Union type example:
372373
>`@return int|null`
@@ -376,50 +377,45 @@ Intersection type example:
376377
377378
#### Arrays
378379

379-
The value represented by "Type" can be an array. The type MUST be defined following the format of one of the
380-
following options:
380+
The value represented by "Type" can be an array. The type MUST be defined
381+
following one of the following options:
381382

382-
1. unspecified: no definition of the contents of the represented array is given.
383+
1. unspecified: no definition of the contents of the array is given.
383384
Example: `@return array`
384385

385-
2. specified containing a single type: the Type definition informs the reader of the type of each array value. Only one
386-
type is then expected for each value in a given array.
387-
386+
2. specified as a specific type: each member of the array is the same one type.
388387
Example: `@return int[]`
389388

390-
Please note that _mixed_ is also a single type and with this keyword it is possible to indicate that each array
391-
value contains any possible type.
389+
Note that `mixed` is also a single type and thus can explicitly indicate that
390+
each member is any possible type.
392391

393-
3. specified as containing multiple types: the Type definition informs the reader of the type of each array value.
394-
Each value can be of any of the given types.
392+
3. specified as containing multiple explicit types: each member can be of any
393+
of the given types.
395394
Example: `@return (int|string)[]`
396395

397396
### Valid Class Name
398397

399-
A valid class name is seen based on the context where this type is mentioned. Thus
400-
this may be either a Fully Qualified Class Name (FQCN) or a local name if present in a
398+
A valid class name is based on the context where this type is mentioned. This
399+
may be a Fully Qualified Class Name (FQCN) or a local name if present in a
401400
namespace.
402401

403402
The element to which this type applies is either an instance of this class
404-
or an instance of a class that is a (sub-)child to the given class.
403+
or an instance of a class that is a sub/child to the given class.
405404

406-
> Due to the above nature, it is RECOMMENDED for applications that
407-
> collect and shape this information to show a list of child classes
408-
> with each representation of the class. This would make it obvious
409-
> for the user which classes are acceptable as type.
405+
> It is RECOMMENDED for applications that collect and shape this information to
406+
> show a list of child classes with each representation of the class. This makes
407+
> it more obvious for the user which classes are acceptable as this type.
410408
411409
### Keyword
412410

413-
A keyword defines the purpose of this type. Not every element is determined by a class but still worthy of
414-
classification to assist the developer in understanding the code covered by the DocBlock.
415-
416-
**Note:**
417-
> Most of these keywords are allowed as class names in PHP and can be hard to distinguish from real classes. As
418-
> such, the keywords MUST be lowercase, as most class names start with an uppercase first character, and you SHOULD NOT
419-
> use classes with these names in your code.
411+
A keyword defines the purpose of this type. Not every element is determined by a
412+
class, but it is still worthy of classification to assist the developer in
413+
understanding the code covered by the DocBlock.
420414

421-
> There are more reasons to not name classes with the names of these keywords, but that falls beyond the scope of this
422-
> specification.
415+
> Some of these keywords are allowed as class names in PHP and can be difficult
416+
> to distinguish from real classes. As such, the keywords MUST be lowercase, as
417+
> most class names start with an uppercase first character... it is RECOMMENDED
418+
> that you not use classes with these names in your code.
423419
424420
The following keywords are recognized by this PSR:
425421

0 commit comments

Comments
 (0)