Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 32c1d88

Browse files
Turn on checkMissingClosureNativeReturnTypehintRule
1 parent 19976c5 commit 32c1d88

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* Correct case for inherited and implemented method names.
2828
* Contravariance for parameter types and covariance for return types in inherited methods (also known as Liskov substitution principle - LSP)
2929
* Check LSP even for static methods
30+
* Check missing typehint in anonymous function when a native one could be added
3031

3132
Additional rules are coming in subsequent releases!
3233

‎rules.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ parameters:
66
checkAlwaysTrueStrictComparison: true
77
checkExplicitMixedMissingReturn: true
88
checkFunctionNameCase: true
9+
checkMissingClosureNativeReturnTypehintRule: true
910
reportMaybesInMethodSignatures: true
1011
reportStaticMethodSignatures: true
1112

‎tests/Levels/data/foreach-0.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"message": "Anonymous function should have native typehint \"void\".",
4+
"line": 3,
5+
"ignorable": true
6+
}
7+
]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /