Skip to content

Commit 32ab4ed

Browse files
committed
remove stuff about Annotations;
1 parent 42135f8 commit 32ab4ed

File tree

1 file changed

+4
-90
lines changed

1 file changed

+4
-90
lines changed

proposed/phpdoc.md

Lines changed: 4 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ PSR-5: PHPDoc
1212
- [5.2. Description](#52-description)
1313
- [5.3. Tags](#53-tags)
1414
- [5.3.1. Tag Name](#531-tag-name)
15-
- [5.3.2. Tag Specialization](#532-tag-specialization)
16-
- [5.3.3. Tag Signature](#533-tag-signature)
1715
- [5.4. Examples](#54-examples)
1816
- [Appendix A. Types](#appendix-a-types)
1917
- [ABNF](#abnf)
@@ -216,9 +214,8 @@ definition:
216214
tag = "@" tag-name [":" tag-specialization] [tag-details]
217215
tag-name = (ALPHA / "\") *(ALPHA / DIGIT / "\" / "-" / "_")
218216
tag-specialization = 1*(ALPHA / DIGIT / "-")
219-
tag-details = (1*SP tag-description) / tag-signature
217+
tag-details = (1*SP tag-description)
220218
tag-description = (CHAR / inline-tag) *(CHAR / inline-tag / eol)
221-
tag-signature = "(" *tag-argument ")"
222219
tag-argument = *SP 1*CHAR [","] *SP
223220

224221
Examples of use are included in chapter 5.4.
@@ -293,96 +290,13 @@ Thus, the following tags are semantically identical:
293290
* @var string
294291
* This is a description.
295292
*/
296-
297-
A variation of this is where, instead of a description, a tag signature is used;
298-
in most cases the tag will in fact be an "Annotation". The tag signature is
299-
able to provide the annotation with parameters regarding its operation.
300-
301-
If a tag signature is present, then there MUST NOT be a description present in
302-
the same tag.
303-
304-
The meta-data supplied by tags could result in a change of actual runtime
305-
behavior of the succeeding "Structural Element", in which case the term
306-
"Annotation" is commonly used instead of "Tag".
307-
308-
#### 5.3.1. Tag Name
309-
310-
Tag names indicate what type of information is represented by this tag, or in
311-
case of annotations, which behaviour must be injected into the succeeding
312-
"Structural Element".
313-
314-
In support of annotations, it is allowable to introduce a set of tags designed
315-
specifically for an individual application or subset of applications (and thus
316-
not covered by this specification).
317-
318-
These tags, or annotations, MUST provide a namespace by either
319-
320-
* prefixing the tag name with a PHP-style namespace, or by
321-
* prefixing the tag name with a single vendor-name followed by a hyphen.
322-
323-
Example of a tag name prefixed with a php-style namespace (the prefixing slash
324-
is OPTIONAL):
325-
326-
```php
327-
@\Doctrine\Orm\Mapping\Entity()
328293
```
329294
330-
> *Note*: The PHPDoc Standard DOES NOT make assumptions on the meaning of a tag
331-
> unless specified in this document or subsequent additions or extensions.
332-
>
333-
> This means that you CAN use namespace aliases as long as a prefixing namespace
334-
> element is provided. Thus the following is legal as well:
335-
>
336-
> @Mapping\Entity()
337-
>
338-
> Your own library or application may check for namespace aliases and make a
339-
> FQCN from this; this has no impact on this standard.
340-
341-
> *Important*: Tools using the PHPDoc Standard MAY interpret namespaces that are
342-
> registered with that application and apply custom behaviour.
295+
This definition does NOT apply to _Annotation_ tags, which are not in scope.
343296
344-
Example of a tag name prefixed with a vendor name and hyphen:
345-
346-
```php
347-
@phpdoc-event transformer.transform.pre
348-
```
349-
350-
Tag names that are not prefixed with a vendor or namespace MUST be described in
351-
the [Tag Catalog PSR][TAG_PSR] and/or any official addendum.
352-
353-
#### 5.3.2. Tag Specialization
354-
355-
In order to provide a method by which to provide nuance to the tags defined in
356-
this standard, but without expanding the base set, a tag specialization MAY be
357-
provided after the tag name by adding a colon followed by a string that provides
358-
a more nuanced description of the tag. The list of supported tag specializations
359-
is not maintained in the [Tag Catalog PSR][TAG_PSR], as it may change over time.
360-
The [Tag Catalog PSR][TAG_PSR] meta document may contain a series of recommendations
361-
on a per-tag name basis, but projects are free to choose their own tag specializations if applicable.
362-
363-
*Important*: Tools using the PHPDoc Standard MAY interpret tag specializations
364-
that are registered with/understood by that application and apply custom
365-
behaviour, but are only expected to implement the preceding tag name as defined
366-
in the [Tag Catalog PSR][TAG_PSR].
367-
368-
For example:
369-
370-
> `@see:unit-test \Mapping\EntityTest::testGetId`
371-
>
372-
> The above tag consists of a name ('see') and tag specialization ('unit-test'),
373-
> and thus defines a relation to the unit test for the proceeding method.
374-
375-
#### 5.3.3. Tag Signature
376-
377-
Tag signatures are commonly used for annotations to supply additional meta-data
378-
specific to the current tag.
379-
380-
The supplied meta-data can influence the behavior of the owning annotation and
381-
as such influence the behavior of the succeeding "Structural Element".
297+
#### 5.3.1. Tag Name
382298
383-
The contents of a signature are to be determined by the tag type (as described
384-
in the tag-name) and fall beyond the scope of this specification. However, a
385-
tag-signature MUST NOT be followed by a description or other form of meta-data.
299+
Tag names indicate what type of information is represented by this tag.
386300
387301
### 5.4. Examples
388302

0 commit comments

Comments
 (0)