File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,6 +124,34 @@ final class MyService extends MyServiceBase
124124
125125PHPDoc, if present, should describe the purpose of the element it's added for.
126126
127+ Skip default values in PHPDoc when PHP already shows them in a parameter default, promoted property default, or property
128+ initializer. The declaration is the source of truth, and repeating the value in text can become outdated after code
129+ changes.
130+
131+ Example of incorrect code:
132+
133+ ``` php
134+ /**
135+ * @param bool $skipOnEmpty Whether to skip validation when the value is empty. Defaults to true.
136+ */
137+ public function __construct(
138+ private bool $skipOnEmpty = true,
139+ ) {
140+ }
141+ ```
142+
143+ Example of a valid code:
144+
145+ ``` php
146+ /**
147+ * @param bool $skipOnEmpty Whether to skip validation when the value is empty.
148+ */
149+ public function __construct(
150+ private bool $skipOnEmpty = true,
151+ ) {
152+ }
153+ ```
154+
127155The ` @see ` tags must explicitly refer to class methods, properties, and constants. This is necessary
128156for the correct display of links in IDEs, as well as for the correct display of links in API documentation.
129157
You can’t perform that action at this time.
0 commit comments