implode_call.rst 935 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. =====================
  2. Rule ``implode_call``
  3. =====================
  4. Function ``implode`` must be called with 2 arguments in the documented order.
  5. .. warning:: Using this rule is risky.
  6. Risky when the function ``implode`` 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. -implode($pieces, '');
  17. +implode('', $pieces);
  18. Example #2
  19. ~~~~~~~~~~
  20. .. code-block:: diff
  21. --- Original
  22. +++ New
  23. @@ -1,2 +1,2 @@
  24. <?php
  25. -implode($pieces);
  26. +implode('', $pieces);
  27. Rule sets
  28. ---------
  29. The rule is part of the following rule sets:
  30. @Symfony:risky
  31. Using the ``@Symfony:risky`` rule set will enable the ``implode_call`` rule.
  32. @PhpCsFixer:risky
  33. Using the ``@PhpCsFixer:risky`` rule set will enable the ``implode_call`` rule.
  34. @PHP80Migration:risky
  35. Using the ``@PHP80Migration:risky`` rule set will enable the ``implode_call`` rule.