PHP 8.2.31
Preview: UnnecessaryHeredocStandard.xml Size: 1.09 KB
/opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryHeredocStandard.xml

<documentation title="Unnecessary Heredoc">
    <standard>
    <![CDATA[
    If no interpolation or expressions are used in the body of a heredoc, nowdoc syntax should be used instead.
    ]]>
    </standard>
    <code_comparison>
        <code title="Valid: Using nowdoc syntax for a text string without any interpolation or expressions.">
        <![CDATA[
$nowdoc = <em><<<'EOD'</em>
some text
EOD;
        ]]>
        </code>
        <code title="Invalid: Using heredoc syntax for a text string without any interpolation or expressions.">
        <![CDATA[
$heredoc = <em><<<EOD</em>
some text
EOD;
        ]]>
        </code>
    </code_comparison>
    <code_comparison>
        <code title="Valid: Using heredoc syntax for a text string containing interpolation or expressions.">
        <![CDATA[
$heredoc = <em><<<"EOD"</em>
some $text
EOD;
        ]]>
        </code>
        <code title="Invalid: Using heredoc syntax for a text string without any interpolation or expressions.">
        <![CDATA[
$heredoc = <em><<<"EOD"</em>
some text
EOD;
        ]]>
        </code>
    </code_comparison>
</documentation>

Directory Contents

Dirs: 0 × Files: 2

Name Size Perms Modified Actions
1.09 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
526 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).