pow_to_exponentiation.rst 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ==============================
  2. Rule ``pow_to_exponentiation``
  3. ==============================
  4. Converts ``pow`` to the ``**`` operator.
  5. .. warning:: Using this rule is risky.
  6. Risky when the function ``pow`` is overridden.
  7. Examples
  8. --------
  9. Example #1
  10. ~~~~~~~~~~
  11. .. code-block:: diff
  12. --- Original
  13. +++ New
  14. @@ -1,2 +1,2 @@
  15. <?php
  16. - pow($a, 1);
  17. + $a** 1;
  18. Rule sets
  19. ---------
  20. The rule is part of the following rule sets:
  21. @Symfony:risky
  22. Using the ``@Symfony:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
  23. @PhpCsFixer:risky
  24. Using the ``@PhpCsFixer:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
  25. @PHP56Migration:risky
  26. Using the ``@PHP56Migration:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
  27. @PHP70Migration:risky
  28. Using the ``@PHP70Migration:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
  29. @PHP71Migration:risky
  30. Using the ``@PHP71Migration:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
  31. @PHP74Migration:risky
  32. Using the ``@PHP74Migration:risky`` rule set will enable the ``pow_to_exponentiation`` rule.
  33. @PHP80Migration:risky
  34. Using the ``@PHP80Migration:risky`` rule set will enable the ``pow_to_exponentiation`` rule.