Fork me on GitHub
a Sensio Labs Product

Jump & Run (v3.28.0) edition

Rule void_return

Add void return type to functions with missing or empty return statements, but priority is given to @return annotations. Requires PHP >= 7.1.


Using this rule is risky

Modifies the signature of functions.


Example #1

--- Original
+++ New
-function foo($a) {};
+function foo($a): void {};

Rule sets

The rule is part of the following rule sets:

The logo is © 2010-2022 Sensio Labs