Repository navigation
Commit 06d8cf7
committed
Fix too-wide return types of functions and methods that cannot be overridden
Under the fixMissingReturnTypes feature toggle, return.unusedType and return.tooWideBool
of functions, private methods and methods that cannot be overridden remove the members
the function never returns, first from the native type, then from the @return tags,
which stay subtypes of the native type. bool becomes true or false only where PHP allows it,
and before PHP 7.4 the native type of an overriding method is not narrowed.
Amp-Thread-ID: https://ampcode.com/threads/T-01a22c96-9e21-771f-9a29-4627539ba3011 parent 1c4ca0d commit 06d8cf7
25 files changed
Lines changed: 1864 additions & 4 deletions
File tree
- src/Rules/TooWideTypehints
- tests/PHPStan/Rules/TooWideTypehints
- data
- fix-too-wide-return-type
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments