Skip to content

Commit

Permalink
Turn on checkMissingClosureNativeReturnTypehintRule
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jul 8, 2019
1 parent 19976c5 commit 32c1d88
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* Correct case for inherited and implemented method names.
* Contravariance for parameter types and covariance for return types in inherited methods (also known as Liskov substitution principle - LSP)
* Check LSP even for static methods
* Check missing typehint in anonymous function when a native one could be added

Additional rules are coming in subsequent releases!

Expand Down
1 change: 1 addition & 0 deletions rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ parameters:
checkAlwaysTrueStrictComparison: true
checkExplicitMixedMissingReturn: true
checkFunctionNameCase: true
checkMissingClosureNativeReturnTypehintRule: true
reportMaybesInMethodSignatures: true
reportStaticMethodSignatures: true

Expand Down
7 changes: 7 additions & 0 deletions tests/Levels/data/foreach-0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"message": "Anonymous function should have native typehint \"void\".",
"line": 3,
"ignorable": true
}
]

0 comments on commit 32c1d88

Please sign in to comment.