Skip to content

Close PHP tags in tests #12422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

iluuu1994
Copy link
Member

@iluuu1994 iluuu1994 commented Oct 11, 2023

Some of these may be intended, I'll check and revert them manually.

Script I used to fix these:

$it = new RecursiveDirectoryIterator(__DIR__);

foreach(new RecursiveIteratorIterator($it) as $file) {
    $path = $file->getPathname();
    if ($file->getExtension() !== 'phpt' || strpos($path, '.git') !== false) {
        continue;
    }

    $content = file_get_contents($path);
    $sections = preg_split('((?=^--\w+--$))m', $content);
    $changed = false;
    foreach ($sections as $i => $section) {
        if (preg_match("(^(--\w+--)\n<\?php)", $section) === 1 && strpos($section, '?>') === false) {
            $sections[$i] .= "?>\n";
            $changed = true;
        }
    }
    if ($changed) {
        file_put_contents($path, implode("", $sections));
    }
}

Edit: Thank you Labeler Bot for that.

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for dom, libxml, xsl

@@ -7,5 +7,6 @@ Note: the closing ?> has been deliberately elided.

echo <<<'END'

?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is incorrect as per the description.

@@ -7,5 +7,6 @@ Note: the closing ?> has been deliberately elided.

echo <<<END

?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -4,5 +4,6 @@ Unterminated comment
<?php
/* Foo
Bar
?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one looks intentional.

@iluuu1994 iluuu1994 closed this in f39b5c4 Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants