@@ -18,20 +18,21 @@ PSR-19: PHPDoc tags
18
18
- [ 5.2. @author ] ( #52-author )
19
19
- [ 5.3. @copyright ] ( #53-copyright )
20
20
- [ 5.4. @deprecated ] ( #54-deprecated )
21
- - [ 5.5. @internal ] ( #55-internal )
22
- - [ 5.6. @link ] ( #56-link )
23
- - [ 5.7. @method ] ( #57-method )
24
- - [ 5.8. @package ] ( #58-package )
25
- - [ 5.9. @param ] ( #59-param )
26
- - [ 5.10. @property ] ( #510-property )
27
- - [ 5.11. @return ] ( #511-return )
28
- - [ 5.12. @see ] ( #512-see )
29
- - [ 5.13. @since ] ( #513-since )
30
- - [ 5.14. @throws ] ( #514-throws )
31
- - [ 5.15. @todo ] ( #515-todo )
32
- - [ 5.16. @uses ] ( #516-uses )
33
- - [ 5.17. @var ] ( #517-var )
34
- - [ 5.18. @version ] ( #518-version )
21
+ - [ 5.5. @generated ] ( #55-generated )
22
+ - [ 5.6. @internal ] ( #56-internal )
23
+ - [ 5.7. @link ] ( #57-link )
24
+ - [ 5.8. @method ] ( #58-method )
25
+ - [ 5.9. @package ] ( #59-package )
26
+ - [ 5.10. @param ] ( #510-param )
27
+ - [ 5.11. @property ] ( #511-property )
28
+ - [ 5.12. @return ] ( #512-return )
29
+ - [ 5.13. @see ] ( #513-see )
30
+ - [ 5.14. @since ] ( #514-since )
31
+ - [ 5.15. @throws ] ( #515-throws )
32
+ - [ 5.16. @todo ] ( #516-todo )
33
+ - [ 5.17. @uses ] ( #517-uses )
34
+ - [ 5.18. @var ] ( #518-var )
35
+ - [ 5.19. @version ] ( #519-version )
35
36
36
37
## 1. Introduction
37
38
@@ -71,7 +72,7 @@ parts if that part is absent:
71
72
* A specific subset of [ Tags] ( [PHPDOC_PSR]#53-tags ) :
72
73
* [ @author ] ( #52-author )
73
74
* [ @copyright ] ( #53-copyright )
74
- * [ @version ] ( #518 -version )
75
+ * [ @version ] ( #519 -version )
75
76
76
77
The PHPDoc for each type of "Structural Element" MUST also inherit a
77
78
specialized subset of tags depending on which "Structural Element" is
@@ -170,23 +171,23 @@ combination of the Description of the super-element, indicated by the
170
171
In addition to the inherited descriptions and tags as defined in this chapter's
171
172
root, a class or interface MUST inherit the following tags:
172
173
173
- * [ @package ] ( #58 -package )
174
+ * [ @package ] ( #59 -package )
174
175
175
176
### 4.3.2. Function Or Method
176
177
177
178
In addition to the inherited descriptions and tags as defined in this chapter's
178
179
root, a function or method in a class or interface MUST inherit the following tags:
179
180
180
- * [ @param ] ( #59 -param )
181
- * [ @return ] ( #511 -return )
182
- * [ @throws ] ( #514 -throws )
181
+ * [ @param ] ( #510 -param )
182
+ * [ @return ] ( #512 -return )
183
+ * [ @throws ] ( #515 -throws )
183
184
184
185
### 4.3.3. Constant Or Property
185
186
186
187
In addition to the inherited descriptions and tags as defined in this chapter's
187
188
root, a constant or property in a class MUST inherit the following tags:
188
189
189
- * [ @var ] ( #517 -type )
190
+ * [ @var ] ( #518 -type )
190
191
191
192
## 5. Tags
192
193
@@ -211,7 +212,7 @@ API components of a library or framework.
211
212
Other "Structural Elements" with a public visibility MAY be listed less
212
213
prominently in generated documentation.
213
214
214
- See also the [ ` @internal ` ] ( #55 -internal ) , which MAY be used to hide internal
215
+ See also the [ ` @internal ` ] ( #56 -internal ) , which MAY be used to hide internal
215
216
"Structural Elements" from generated documentation.
216
217
217
218
#### Examples
@@ -326,7 +327,58 @@ If the associated element is superseded by another it is RECOMMENDED to add a
326
327
*/
327
328
```
328
329
329
- ### 5.5. @internal
330
+ ### 5.5. @generated
331
+
332
+ The @generated tag indicates that the code has been generated using an
333
+ automation script.
334
+
335
+ #### Syntax
336
+
337
+ @generated [description]
338
+
339
+ #### Description
340
+
341
+ The ` @generated ` is used to denote a class or a function that has been
342
+ generated using an automation script. This tag should be used to warn
343
+ to not change the code, since the change will be overwritten by the
344
+ automation script.
345
+
346
+ #### Examples
347
+
348
+ Mark a class that has been generated using a PHP script.
349
+
350
+ ``` php
351
+ /**
352
+ * Index a document in Elasticsearch
353
+ *
354
+ * @generated class generated using bin/script.php, please DO NOT EDIT!
355
+ *
356
+ * @version 7.14.0 Elasticsearch
357
+ */
358
+ class Index
359
+ {
360
+ <...>
361
+ }
362
+ ```
363
+
364
+ Mark a function that has been generated using a PHP script.
365
+
366
+ ``` php
367
+
368
+ /**
369
+ * @generated function generated using bin/script.php, please DO NOT EDIT!
370
+ *
371
+ * @params array $params parameters for the index API endpoint
372
+ *
373
+ * @return array response from Elasticsearch
374
+ */
375
+ function index(array $params): array
376
+ {
377
+ <...>
378
+ }
379
+ ```
380
+
381
+ ### 5.6. @internal
330
382
331
383
The @internal tag is used to denote that the associated "Structural Element" is
332
384
a structure internal to this application or library. It may also be used inside
@@ -399,7 +451,7 @@ function count()
399
451
}
400
452
```
401
453
402
- ### 5.6 . @link
454
+ ### 5.7 . @link
403
455
404
456
The @link tag indicates a custom relation between the associated
405
457
"Structural Element" and a website, which is identified by an absolute URI.
@@ -449,7 +501,7 @@ function count()
449
501
}
450
502
```
451
503
452
- ### 5.7 . @method
504
+ ### 5.8 . @method
453
505
454
506
The @method allows a class to know which 'magic' methods are callable.
455
507
@@ -499,7 +551,7 @@ class Child extends Parent
499
551
}
500
552
```
501
553
502
- ### 5.8 . @package
554
+ ### 5.9 . @package
503
555
504
556
The @package tag is used to categorize "Structural Elements" into logical
505
557
subdivisions.
@@ -536,7 +588,7 @@ This tag MUST NOT occur more than once in a "DocBlock".
536
588
*/
537
589
```
538
590
539
- ### 5.9 . @param
591
+ ### 5.10 . @param
540
592
541
593
The @param tag is used to document a single parameter of a function or method.
542
594
@@ -577,7 +629,7 @@ function count(array $items)
577
629
}
578
630
```
579
631
580
- ### 5.10 . @property
632
+ ### 5.11 . @property
581
633
582
634
The ` @property ` tag is used to declare which "magic" properties are supported.
583
635
@@ -626,7 +678,7 @@ class User
626
678
}
627
679
```
628
680
629
- ### 5.11 . @return
681
+ ### 5.12 . @return
630
682
631
683
The @return tag is used to document the return value of functions or methods.
632
684
@@ -675,7 +727,7 @@ function getLabel()
675
727
}
676
728
```
677
729
678
- ### 5.12 . @see
730
+ ### 5.13 . @see
679
731
680
732
The @see tag indicates a reference from the associated "Structural Elements" to
681
733
a website or other "Structural Elements".
@@ -717,7 +769,7 @@ function count()
717
769
}
718
770
```
719
771
720
- ### 5.13 . @since
772
+ ### 5.14 . @since
721
773
722
774
The @since tag is used to denote _ when_ an element was introduced or modified,
723
775
using some description of "versioning" to that element.
@@ -767,7 +819,7 @@ class Foo
767
819
}
768
820
```
769
821
770
- ### 5.14 . @throws
822
+ ### 5.15 . @throws
771
823
772
824
The @throws tag is used to indicate whether "Structural Elements" throw a
773
825
specific type of Throwable (exception or error).
@@ -810,7 +862,7 @@ function count($items)
810
862
}
811
863
```
812
864
813
- ### 5.15 . @todo
865
+ ### 5.16 . @todo
814
866
815
867
The @todo tag is used to indicate whether any development activities should
816
868
still be executed on associated "Structural Elements".
@@ -842,7 +894,7 @@ function count()
842
894
}
843
895
```
844
896
845
- ### 5.16 . @uses
897
+ ### 5.17 . @uses
846
898
847
899
Indicates whether the current "Structural Element" consumes the
848
900
"Structural Element", or project file, that is provided as target.
@@ -895,7 +947,7 @@ function executeMyView()
895
947
}
896
948
```
897
949
898
- ### 5.17 . @var
950
+ ### 5.18 . @var
899
951
900
952
You may use the @var tag to document the "Type" of the following
901
953
"Structural Elements":
@@ -999,7 +1051,7 @@ class Foo
999
1051
}
1000
1052
```
1001
1053
1002
- ### 5.18 . @version
1054
+ ### 5.19 . @version
1003
1055
1004
1056
The @version tag is used to denote some description of "versioning" to an
1005
1057
element.
0 commit comments