=================== Rule ``yoda_style`` =================== Write conditions in Yoda style (``true``), non-Yoda style (``['equal' => false, 'identical' => false, 'less_and_greater' => false]``) or ignore those conditions (``null``) based on configuration. Configuration ------------- ``equal`` ~~~~~~~~~ Style for equal (``==``, ``!=``) statements. Allowed types: ``bool`` and ``null`` Default value: ``true`` ``identical`` ~~~~~~~~~~~~~ Style for identical (``===``, ``!==``) statements. Allowed types: ``bool`` and ``null`` Default value: ``true`` ``less_and_greater`` ~~~~~~~~~~~~~~~~~~~~ Style for less and greater than (``<``, ``<=``, ``>``, ``>=``) statements. Allowed types: ``bool`` and ``null`` Default value: ``null`` ``always_move_variable`` ~~~~~~~~~~~~~~~~~~~~~~~~ Whether variables should always be on non assignable side when applying Yoda style. Allowed types: ``bool`` Default value: ``false`` Examples -------- Example #1 ~~~~~~~~~~ *Default* configuration. .. code-block:: diff --- Original +++ New true, 'identical' => false, 'less_and_greater' => null]``. .. code-block:: diff --- Original +++ New 3; // less than Example #3 ~~~~~~~~~~ With configuration: ``['always_move_variable' => true]``. .. code-block:: diff --- Original +++ New false, 'identical' => false, 'less_and_greater' => false]``. .. code-block:: diff --- Original +++ New `_ - `@Symfony <./../../ruleSets/Symfony.rst>`_