Skip to content

Commit

Permalink
Do not check void return type usage for constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 1, 2017
1 parent 8612f05 commit 9c330c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Rules/FunctionCallParametersCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ public function check(ParametersAcceptor $function, Scope $scope, $funcCall, arr
}
}

if ($function->getReturnType() instanceof VoidType && !$scope->isInFirstLevelStatement()) {
if (
$function->getReturnType() instanceof VoidType
&& !$scope->isInFirstLevelStatement()
&& !$funcCall instanceof \PhpParser\Node\Expr\New_
) {
$errors[] = $messages[7];
}

Expand Down

0 comments on commit 9c330c3

Please sign in to comment.