magic_method_casing.rst 793 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ============================
  2. Rule ``magic_method_casing``
  3. ============================
  4. Magic method definitions and calls must be using the correct casing.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. @@ -1,7 +1,7 @@
  13. <?php
  14. class Foo
  15. {
  16. - public function __Sleep()
  17. + public function __sleep()
  18. {
  19. }
  20. }
  21. Example #2
  22. ~~~~~~~~~~
  23. .. code-block:: diff
  24. --- Original
  25. +++ New
  26. @@ -1,2 +1,2 @@
  27. <?php
  28. -$foo->__INVOKE(1);
  29. +$foo->__invoke(1);
  30. Rule sets
  31. ---------
  32. The rule is part of the following rule sets:
  33. @Symfony
  34. Using the ``@Symfony`` rule set will enable the ``magic_method_casing`` rule.
  35. @PhpCsFixer
  36. Using the ``@PhpCsFixer`` rule set will enable the ``magic_method_casing`` rule.