implode_call.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. =====================
  2. Rule ``implode_call``
  3. =====================
  4. Function ``implode`` must be called with 2 arguments in the documented order.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Risky when the function ``implode`` is overridden.
  10. Examples
  11. --------
  12. Example #1
  13. ~~~~~~~~~~
  14. .. code-block:: diff
  15. --- Original
  16. +++ New
  17. <?php
  18. -implode($pieces, '');
  19. +implode('', $pieces);
  20. Example #2
  21. ~~~~~~~~~~
  22. .. code-block:: diff
  23. --- Original
  24. +++ New
  25. <?php
  26. -implode($pieces);
  27. +implode('', $pieces);
  28. Rule sets
  29. ---------
  30. The rule is part of the following rule sets:
  31. - `@PHP74Migration:risky <./../../ruleSets/PHP74MigrationRisky.rst>`_
  32. - `@PHP80Migration:risky <./../../ruleSets/PHP80MigrationRisky.rst>`_
  33. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_
  34. - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_
  35. References
  36. ----------
  37. - Fixer class: `PhpCsFixer\\Fixer\\FunctionNotation\\ImplodeCallFixer <./../../../src/Fixer/FunctionNotation/ImplodeCallFixer.php>`_
  38. - Test class: `PhpCsFixer\\Tests\\Fixer\\FunctionNotation\\ImplodeCallFixerTest <./../../../tests/Fixer/FunctionNotation/ImplodeCallFixerTest.php>`_
  39. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.