File "MultiLineConditionStandard.xml"

Full Path: /home/warrior1/public_html/themes/storefront/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/ControlStructures/MultiLineConditionStandard.xml
File size: 1.27 KB
MIME-type: text/plain
Charset: utf-8

<documentation title="Multi-line If Conditions">
    <standard>
    <![CDATA[
    Multi-line if conditions should be indented one level and each line should begin with a boolean operator.  The end parenthesis should be on a new line.
    ]]>
    </standard>
    <code_comparison>
        <code title="Valid: Correct indentation.">
        <![CDATA[
if ($foo
<em>    </em>&& $bar
) {
}
        ]]>
        </code>
        <code title="Invalid: No indentation used on the condition lines.">
        <![CDATA[
if ($foo
<em></em>&& $bar
) {
}
        ]]>
        </code>
    </code_comparison>
    <code_comparison>
        <code title="Valid: Boolean operator at the start of the line.">
        <![CDATA[
if ($foo
    <em>&&</em> $bar
) {
}
        ]]>
        </code>
        <code title="Invalid: Boolean operator at the end of the line.">
        <![CDATA[
if ($foo <em>&&</em>
    $bar
) {
}
        ]]>
        </code>
    </code_comparison>
    <code_comparison>
        <code title="Valid: End parenthesis on a new line.">
        <![CDATA[
if ($foo
    && $bar
<em>)</em> {
}
        ]]>
        </code>
        <code title="Invalid: End parenthesis not moved to a new line.">
        <![CDATA[
if ($foo
    && $bar<em>)</em> {
}
        ]]>
        </code>
    </code_comparison>
</documentation>