ternary_operator_spaces.rst 631 B

12345678910111213141516171819202122232425262728293031
  1. ================================
  2. Rule ``ternary_operator_spaces``
  3. ================================
  4. Standardize spaces around ternary operator.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. -<?php $a = $a ?1 :0;
  13. +<?php $a = $a ? 1 : 0;
  14. Rule sets
  15. ---------
  16. The rule is part of the following rule sets:
  17. - `@PER <./../../ruleSets/PER.rst>`_
  18. - `@PER-CS1.0 <./../../ruleSets/PER-CS1.0.rst>`_
  19. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  20. - `@PSR12 <./../../ruleSets/PSR12.rst>`_
  21. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  22. - `@Symfony <./../../ruleSets/Symfony.rst>`_