File "DisallowYodaConditionsStandard.xml"

Full Path: /home/warrior1/public_html/wp-content/themes/storefront/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/ControlStructures/DisallowYodaConditionsStandard.xml
File size: 578 bytes
MIME-type: text/plain
Charset: utf-8

<documentation title="Disallow Yoda conditions">
    <standard>
    <![CDATA[
    Yoda conditions are disallowed.
    ]]>
    </standard>
    <code_comparison>
        <code title="Valid: value to be asserted must go on the right side of the comparison.">
        <![CDATA[
if ($test === null) <em>{</em>
    $var = 1;
<em>}</em>
        ]]>
        </code>
        <code title="Invalid: value to be asserted must not be on the left.">
        <![CDATA[
if (null === $test) <em>{</em>
    $var = 1;
<em>}</em>
        ]]>
        </code>
    </code_comparison>
</documentation>