lowercase_keywords.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. @@ -1,11 +1,11 @@
  13. <?php
  14. - FOREACH($a AS $B) {
  15. - TRY {
  16. - NEW $C($a, ISSET($B));
  17. - WHILE($B) {
  18. - INCLUDE "test.php";
  19. + foreach($a as $B) {
  20. + try {
  21. + new $C($a, isset($B));
  22. + while($B) {
  23. + include "test.php";
  24. }
  25. - } CATCH(\Exception $e) {
  26. - EXIT(1);
  27. + } catch(\Exception $e) {
  28. + exit(1);
  29. }
  30. }
  31. Rule sets
  32. ---------
  33. The rule is part of the following rule sets:
  34. @PSR12
  35. Using the `@PSR12 <./../../ruleSets/PSR12.rst>`_ rule set will enable the ``lowercase_keywords`` rule.
  36. @PSR2
  37. Using the `@PSR2 <./../../ruleSets/PSR2.rst>`_ rule set will enable the ``lowercase_keywords`` rule.
  38. @PhpCsFixer
  39. Using the `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ rule set will enable the ``lowercase_keywords`` rule.
  40. @Symfony
  41. Using the `@Symfony <./../../ruleSets/Symfony.rst>`_ rule set will enable the ``lowercase_keywords`` rule.