no_useless_concat_operator.rst 879 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ===================================
  2. Rule ``no_useless_concat_operator``
  3. ===================================
  4. There should not be useless concat operations.
  5. Configuration
  6. -------------
  7. ``juggle_simple_strings``
  8. ~~~~~~~~~~~~~~~~~~~~~~~~~
  9. Allow for simple string quote juggling if it results in more concat-operations
  10. merges.
  11. Allowed types: ``bool``
  12. Default value: ``false``
  13. Examples
  14. --------
  15. Example #1
  16. ~~~~~~~~~~
  17. *Default* configuration.
  18. .. code-block:: diff
  19. --- Original
  20. +++ New
  21. <?php
  22. -$a = 'a'.'b';
  23. +$a = 'ab';
  24. Example #2
  25. ~~~~~~~~~~
  26. With configuration: ``['juggle_simple_strings' => true]``.
  27. .. code-block:: diff
  28. --- Original
  29. +++ New
  30. <?php
  31. -$a = 'a'."b";
  32. +$a = "ab";
  33. Rule sets
  34. ---------
  35. The rule is part of the following rule sets:
  36. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  37. - `@Symfony <./../../ruleSets/Symfony.rst>`_