File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 0.9.0
4
+ - ` ReturnTypeDeclarationSniff ` do no warn for missing return type when a docbloc like:
5
+ ` @return {aType}|null ` exists for the function.
6
+
3
7
## 0.8.0
4
8
- Fix bug in ` NoAccessorsSniff ` and allow for a few method names related to PHP core interfaces.
5
9
- Exclude ` ArrayAccess ` methods from ` ReturnTypeDeclarationSniff ` and ` ArgumentTypeDeclarationSniff ` .
Original file line number Diff line number Diff line change @@ -146,6 +146,19 @@ Customs rules are:
146
146
147
147
The tree of used rules are listed in the ` /docs/rules-list/custom.md ` file in this repo.
148
148
149
+ ### Notes
150
+
151
+ #### Skip ` InpsydeCodingStandard.CodeQuality.ReturnTypeDeclaration.NoReturnType ` via doc bloc
152
+
153
+ As of v0.9, when there's no return type declared for a function, but it has a docbloc like:
154
+ ` @return {$type}|null ` and the function _ actually_ contains both ` null ` and not-null return
155
+ points ** no** warning is shown.
156
+ However, if min PHP version is set to 7.1 via php-compatibility ` testVersion ` config, the warning
157
+ ** is** shown, because in PHP 7.1 there's the availability for nullable return types.
158
+ Also note that the warning ** is** shown in case:
159
+ - the ` @return ` docbloc declares more than one not-null types, e.g. ` @return Foo|Bar|null `
160
+ - the ` @return ` docbloc types contains "mixed", e.g. ` @return mixed|null ` .
161
+
149
162
-------------
150
163
151
164
# Removing or Disabling Rules
You can’t perform that action at this time.
0 commit comments