implode_call.rst 877 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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>`_