magic_method_casing.rst 667 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. <?php
  13. class Foo
  14. {
  15. - public function __Sleep()
  16. + public function __sleep()
  17. {
  18. }
  19. }
  20. Example #2
  21. ~~~~~~~~~~
  22. .. code-block:: diff
  23. --- Original
  24. +++ New
  25. <?php
  26. -$foo->__INVOKE(1);
  27. +$foo->__invoke(1);
  28. Rule sets
  29. ---------
  30. The rule is part of the following rule sets:
  31. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  32. - `@Symfony <./../../ruleSets/Symfony.rst>`_