lowercase_cast.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. =======================
  2. Rule ``lowercase_cast``
  3. =======================
  4. Cast should be written in lower case.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. - $a = (BOOLEAN) $b;
  14. - $a = (BOOL) $b;
  15. - $a = (INTEGER) $b;
  16. - $a = (INT) $b;
  17. - $a = (DOUBLE) $b;
  18. - $a = (FLoaT) $b;
  19. - $a = (flOAT) $b;
  20. - $a = (sTRING) $b;
  21. - $a = (ARRAy) $b;
  22. - $a = (OBJect) $b;
  23. - $a = (UNset) $b;
  24. - $a = (Binary) $b;
  25. + $a = (boolean) $b;
  26. + $a = (bool) $b;
  27. + $a = (integer) $b;
  28. + $a = (int) $b;
  29. + $a = (double) $b;
  30. + $a = (float) $b;
  31. + $a = (float) $b;
  32. + $a = (string) $b;
  33. + $a = (array) $b;
  34. + $a = (object) $b;
  35. + $a = (unset) $b;
  36. + $a = (binary) $b;
  37. Rule sets
  38. ---------
  39. The rule is part of the following rule sets:
  40. - `@PER <./../../ruleSets/PER.rst>`_
  41. - `@PER-CS <./../../ruleSets/PER-CS.rst>`_
  42. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  43. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  44. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  45. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  46. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  47. References
  48. ----------
  49. - Fixer class: `PhpCsFixer\\Fixer\\CastNotation\\LowercaseCastFixer <./../../../src/Fixer/CastNotation/LowercaseCastFixer.php>`_
  50. - Test class: `PhpCsFixer\\Tests\\Fixer\\CastNotation\\LowercaseCastFixerTest <./../../../tests/Fixer/CastNotation/LowercaseCastFixerTest.php>`_
  51. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.