Skip to content

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


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.


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

<?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