pow_to_exponentiation.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ==============================
  2. Rule ``pow_to_exponentiation``
  3. ==============================
  4. Converts ``pow`` to the ``**`` operator.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Risky when the function ``pow`` is overridden.
  10. Examples
  11. --------
  12. Example #1
  13. ~~~~~~~~~~
  14. .. code-block:: diff
  15. --- Original
  16. +++ New
  17. <?php
  18. - pow($a, 1);
  19. + $a** 1;
  20. Rule sets
  21. ---------
  22. The rule is part of the following rule sets:
  23. - `@PHP56Migration:risky <./../../ruleSets/PHP56MigrationRisky.rst>`_
  24. - `@PHP70Migration:risky <./../../ruleSets/PHP70MigrationRisky.rst>`_
  25. - `@PHP71Migration:risky <./../../ruleSets/PHP71MigrationRisky.rst>`_
  26. - `@PHP74Migration:risky <./../../ruleSets/PHP74MigrationRisky.rst>`_
  27. - `@PHP80Migration:risky <./../../ruleSets/PHP80MigrationRisky.rst>`_
  28. - `@PHP82Migration:risky <./../../ruleSets/PHP82MigrationRisky.rst>`_
  29. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_
  30. - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_
  31. References
  32. ----------
  33. - Fixer class: `PhpCsFixer\\Fixer\\Alias\\PowToExponentiationFixer <./../../../src/Fixer/Alias/PowToExponentiationFixer.php>`_
  34. - Test class: `PhpCsFixer\\Tests\\Fixer\\Alias\\PowToExponentiationFixerTest <./../../../tests/Fixer/Alias/PowToExponentiationFixerTest.php>`_
  35. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.