Fork me on GitHub
a Sensio Labs Product

Remote Void (v2.18.1) edition

Rule simplified_if_return

Simplify if control structures that return the boolean result of their condition.

Examples

Example #1

--- Original
+++ New
@@ -1,2 +1,2 @@
 <?php
-if ($foo) { return true; } return false;
+return (bool) ($foo)      ;
The logo is © 2010-2014 Sensio Labs