Skip to content

Latest commit

 

History

History
62 lines (51 loc) · 1.59 KB

lowercase_cast.rst

File metadata and controls

62 lines (51 loc) · 1.59 KB

Rule lowercase_cast

Cast should be written in lower case.

Examples

Example #1

--- Original
+++ New
 <?php
-    $a = (BOOLEAN) $b;
-    $a = (BOOL) $b;
-    $a = (INTEGER) $b;
-    $a = (INT) $b;
-    $a = (DOUBLE) $b;
-    $a = (FLoaT) $b;
-    $a = (flOAT) $b;
-    $a = (sTRING) $b;
-    $a = (ARRAy) $b;
-    $a = (OBJect) $b;
-    $a = (UNset) $b;
-    $a = (Binary) $b;
+    $a = (boolean) $b;
+    $a = (bool) $b;
+    $a = (integer) $b;
+    $a = (int) $b;
+    $a = (double) $b;
+    $a = (float) $b;
+    $a = (float) $b;
+    $a = (string) $b;
+    $a = (array) $b;
+    $a = (object) $b;
+    $a = (unset) $b;
+    $a = (binary) $b;

Rule sets

The rule is part of the following rule sets:

References

The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.