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 491540d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion tests/Levels/data/foreach.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

function () {
function (): void {
foreach ([1, 2, 3] as $val) {
if (rand(0, 1) === 0) {
break;
Expand Down

0 comments on commit 491540d

Please sign in to comment.