Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 356 Bytes

simplified_if_return.rst

File metadata and controls

20 lines (15 loc) · 356 Bytes

Rule simplified_if_return

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

Examples

Example #1

--- Original
+++ New
 <?php
-if ($foo) { return true; } return false;
+return (bool) ($foo)      ;