lowercase_keywords.rst 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ===========================
  2. Rule ``lowercase_keywords``
  3. ===========================
  4. PHP keywords MUST be in lower case.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. - FOREACH($a AS $B) {
  14. - TRY {
  15. - NEW $C($a, ISSET($B));
  16. - WHILE($B) {
  17. - INCLUDE "test.php";
  18. + foreach($a as $B) {
  19. + try {
  20. + new $C($a, isset($B));
  21. + while($B) {
  22. + include "test.php";
  23. }
  24. - } CATCH(\Exception $e) {
  25. - EXIT(1);
  26. + } catch(\Exception $e) {
  27. + exit(1);
  28. }
  29. }
  30. Rule sets
  31. ---------
  32. The rule is part of the following rule sets:
  33. - `@PER <./../../ruleSets/PER.rst>`_
  34. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  35. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  36. - `@PSR2 <./../../ruleSets/PSR2.rst>`_
  37. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  38. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  39. - `@Symfony <./../../ruleSets/Symfony.rst>`_