Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 514 Bytes

no_useless_else.rst

File metadata and controls

33 lines (25 loc) · 514 Bytes

Rule no_useless_else

There should not be useless else cases.

Examples

Example #1

--- Original
+++ New
@@ -1,6 +1,6 @@
 <?php
 if ($a) {
     return 1;
-} else {
+}
     return 2;
-}
+

Rule sets

The rule is part of the following rule set:

@PhpCsFixer
Using the @PhpCsFixer rule set will enable the no_useless_else rule.