Skip to content

Commit f949b50

Browse files
gsherwoodjrfnl
authored andcommitted
Updated Customisable Sniff Properties (markdown)
1 parent 46ccc96 commit f949b50

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

wiki/Customisable-Sniff-Properties.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,7 @@ One of the rules that this sniff enforces is the indent of a list of implemented
11241124

11251125
Property Name | Type | Default | Available Since
11261126
----------------- | ------ | ------- | --------------
1127+
skipIfInheritdoc | bool | false | 3.6.0
11271128
minimumVisibility | string | private | 3.6.0
11281129

11291130
> Note: The `minimumVisibility` property is inherited from the [PEAR.Commenting.FunctionComment](#pearcommentingfunctioncomment) sniff.
@@ -1138,6 +1139,25 @@ This sniff verifies that functions are documented using a docblock. By default,
11381139
</rule>
11391140
```
11401141

1142+
If you make use of the `@inheritdoc` tag to inherit the parent function's entire docblock, the sniff will continue to report errors about missing tags unless you set the `skipIfInheritdoc` property to `true`.
1143+
1144+
```xml
1145+
<rule ref="Squiz.Commenting.FunctionComment">
1146+
<properties>
1147+
<property name="skipIfInheritdoc" value="true" />
1148+
</properties>
1149+
</rule>
1150+
```
1151+
1152+
Doing this will cause the sniff to skip the checking of function comments that contain only the content `{@inheritdoc}`, such as:
1153+
1154+
```php
1155+
/**
1156+
* {@inheritDoc}
1157+
*/
1158+
public function foo($a, $b) {}
1159+
```
1160+
11411161
### Squiz.Commenting.LongConditionClosingComment
11421162

11431163
Property Name | Type | Default | Available Since

0 commit comments

Comments
 (0)