================================== Rule ``ternary_to_elvis_operator`` ================================== Use the Elvis operator ``?:`` where possible. Warning ------- Using this rule is risky ~~~~~~~~~~~~~~~~~~~~~~~~ Risky when relying on functions called on both sides of the ``?`` operator. Examples -------- Example #1 ~~~~~~~~~~ .. code-block:: diff --- Original +++ New `_ - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_ References ---------- - Fixer class: `PhpCsFixer\\Fixer\\Operator\\TernaryToElvisOperatorFixer <./../../../src/Fixer/Operator/TernaryToElvisOperatorFixer.php>`_ - Test class: `PhpCsFixer\\Tests\\Fixer\\Operator\\TernaryToElvisOperatorFixerTest <./../../../tests/Fixer/Operator/TernaryToElvisOperatorFixerTest.php>`_ The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.