Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.31 KB

rector_rules_overview.md

File metadata and controls

64 lines (45 loc) · 1.31 KB

3 Rules Overview

PassStrictParameterToFunctionParameterRector

Pass strict to function parameter on specific position argument when no value provided

-array_search($value, $array);
+array_search($value, $array, true);

-base64_decode($string);
+base64_decode($string, true);

-in_array('a', $array);
+in_array('a', $array, true);

RemoveErrorSuppressInTryCatchStmtsRector

Remove error suppression operator @ inside try...catch blocks

 try {
-		@rmdir($dirname);
-	} catch (Exception $e) {}
+	rmdir($dirname);
+} catch (Exception $e) {}

UnderscoreToCamelCaseVariableNameRector

Change under_score names to camelCase

 final class SomeClass
 {
-    public function run($a_b)
+    public function run($aB)
     {
-        $some_value = $a_b;
+        $someValue = $aB;
     }
 }