PHP 8.2.31
Preview: EmbeddedPhpUnitTest.1.inc Size: 6.68 KB
//opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc

<?php
    // Not embedded. Do not check here.
    echo 'Long open tag test case file';
?>
<html>
<head>
<title><?php echo $title ?></title>
<script><?php echo $script; ?></script>
</head>
<body>
    <?php
        echo $body;
    ?>
    hello
    <?php
    echo $moreBody;
    ?>
    <?php  echo 'one'; ?>
    <?php  echo 'two';   ?>
    <?php echo 'three;' ?>
    <?php echo 'fourA'; echo 'fourB;'; ?>
    <?php  echo 'fiveA'; echo 'fiveB;';   ?>

    <?php
    ?>
    <?php ?>

    <?php

        echo $start - $indent + $end;

    ?>
    <?php

    echo $blankLines;

        ?>

    <?php
    echo $closerNeedsOwnLine; ?>
    <?php echo $openerNeedsOwnLine;
    ?>

            <?php
        echo 'hi';
            ?>

    <?php
echo 'hi';
    ?>
</body>
</html>
<?php
function test()
{
    foreach ($root->section as $section) {
        ?>
        <table>
            <?php if ($foo) {
            ?>
            <tr>
            </tr>
            <?php }
            ?>
        <?php
        foreach ($bar as $bar) {
            echo $bar;
        }
    }

    foreach ($root->section as $section) {
        ?>
        <table>
            <?php
            if ($foo) {
            ?>
            <tr>
            </tr>
            <?php
}
            ?>
        <?php
        foreach ($bar as $bar) {
            echo $bar;
        }
    }
}

echo 'goodbye';

function foo()
{

    ?><a onClick="Javascript: set_hidden_field('<?php echo $link_offset - $num_per_page; ?>'); set_hidden_field('process_form', '0'); submit_form(); return false;"><?php

}

?>

            <strong><?php
            echo 'foo';
            ?></strong>

?>

</html>

<?php if ($foo) { ?>
<?php } ?>

<?php echo 'okay'; // Something. ?>
<?php echo 'too much space before close'; // Something.      ?>
<?php echo 'no space before close'; // Something.?>

<?php /* translators: okay */ ?>
<?php /* translators: no space before close */?>
<?php /* translators: too much space before close */      ?>

<?php echo 'okay'; // phpcs:ignore Standard.Category.Sniff -- reason. ?>
<?php echo 'too much space before close'; // phpcs:ignore Standard.Category.Sniff -- reason.    ?>
<?php echo 'no space before close'; // phpcs:ignore Standard.Category.Sniff -- reason.?>

<!--
Make sure the empty tag set fixer removes the complete line, including indentation for an empty tag set and ensure
that the fixer does not remove too many tokens, like new lines tokens _before_ the affected line
or indentation if there is code _after_ the removed empty tag.
-->
        <div><?php ?></div>
    <?php ?><?php echo $i; ?>


        <?php ?>

    <?php if (true) { ?><?php echo $i; ?>  <?php ?>  <?php } ?>

        <div><?php
        ?></div>
    <?php
    ?><?php echo $i; ?>


    <?php
    ?>

    <?php if (true) { ?><?php echo $i; ?>  <?php
    ?>  <?php } ?>

<!--
Make sure the "content after opener" fixer does not leave trailing space behind.
-->
    <?php   echo $openerNeedsOwnLine;
    ?>

<!--
Make sure the "content before closer" fixer does not leave trailing space behind.
-->
    <?php
    echo $closerNeedsOwnLine;   ?>

<!--
Make sure the "content after closer" fixer does not leave trailing space behind.
-->
    <?php
    echo $closerNeedsOwnLine;
    ?>  </div>

    <?php
    echo $closerNeedsOwnLine;
    ?>  <?php echo $i; ?>

<!--
Make sure the fixer does not add stray new lines when there are consecutive PHP blocks.
-->
<?php
    // Do something.
    ?><?php
    echo 'embedded';
    ?>  <?php
        echo 'embedded';
    ?><?php
echo 'embedded';
    ?>

<!--
Safeguard closing tag indent calculation for when the last content on the close tag line is a scope closer.
-->
<?php if (true) { ?>
<?php
    } ?>

<!--
Safeguard that blank lines between a PHP tag and a scope closer are not touched as the scope closer may have its own rules.
-->
    <?php if ($foo) { ?>
    <tr></tr>
    <?php


}
    ?>

<!--
Safeguard correct content indent calculation.
-->
<?php
echo 'indent is correct - first on line for open tag is open tag';
?>

    <?php
    echo 'indent is correct - first on line for open tag is inline HTML without content';
    ?>
        <div><?php
        echo 'indent is correct - first on line for open tag is inline HTML with content';
    ?><?php
    echo 'indent is correct - first on line for open tag is whitespace';
?>

<?php
    echo 'indent is incorrect - first on line for open tag is open tag';
?>

    <?php
       echo 'indent is incorrect - first on line for open tag is inline HTML';
    ?>
        <div><?php
                       echo 'indent is correct - first on line for open tag is inline HTML with content';
    ?><?php
echo 'indent is incorrect - first on line for open tag is whitespace';
?>

<!--
Safeguard correct close tag indent calculation.
-->
    <?php
    /* Single line star comments are not problematic. */ ?>

    <?php
    /* Subsequent lines of inline slash-star comments
       contain the indent in the comment token.
       This means the calculated indent would be 0 unless we
       walk to the first line in the comment. */ ?>

<!--
Safeguard correct open tag indent calculation when the previous non-empty line contains a comment.
-->
    <?php
    /* Subsequent lines of inline slash-star comments
       contain the indent in the comment token. */ ?>
<?php
echo 'the PHP tag is correctly indented as an indent less than the previous code indent is accepted';

    /* Subsequent lines of inline slash-star comments
       contain the indent in the comment token. */ ?>
    <?php
    echo 'the PHP tag is correctly indented';

    /* Subsequent lines of inline slash-star comments
       contain the indent in the comment token. */ ?>
        <?php
        echo 'the PHP tag is correctly indented as a diff of 4 is accepted';

    /* Subsequent lines of inline slash-star comments
       contain the indent in the comment token. */ ?>
                <?php
                echo 'the PHP tag is incorrectly indented as the indent is more than 4 different from the indent of the previous code';
    ?>

<?PHP echo 'Uppercase long open tag'; ?>

<?PHP  echo 'Extra space after uppercase long open tag '; ?>

<?php echo 'Open tag after code'; ?>            <?php
echo $j;
?>

    <?php echo 'Open tag after code - indented'; ?>            <?php
    echo $j;
    /* comment
    */ /*comment*/ ?>            <?php
    /**
     * Docblock.
     */   ?>            <?php
    echo $j;
    ?>

<?php
enum BlankLineBeforeCloseShouldBeIgnoredWhenLastBeforeIsCloseCurlyForScope
{
}//trailing comment

?>

<?php
// This test case file MUST always end with an unclosed long open PHP tag (with this comment) to prevent
// the tests running into the "last PHP closing tag excepted" condition breaking tests.
// Tests related to that "last PHP closing tag excepted" condition should go in separate files.

Directory Contents

Dirs: 0 × Files: 75

Name Size Perms Modified Actions
489 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
2.99 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.96 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
353 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.42 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.56 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.56 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
290 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
46 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.66 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
2.82 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
198 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.80 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
772 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
253 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.97 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
99 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.38 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
6.68 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
6.60 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
298 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
290 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
2.79 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
2.83 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
308 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
299 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.67 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.56 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
392 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
377 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
450 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
448 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
515 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
511 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
478 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
472 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
470 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
464 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
435 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
510 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
504 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
497 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
533 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
520 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
600 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
589 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
587 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
583 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
580 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
576 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.38 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.38 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
746 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.03 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.03 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
802 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
796 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
6.03 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
66 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.30 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
173 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.33 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
241 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
353 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.54 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.59 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.38 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.09 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.09 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.45 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
8.25 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.25 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.50 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
195 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
3.14 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download

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