Merge pull request #3395 from shaal/do-not-remove-empty-php-code

This commit is contained in:
Tomas Votruba 2020-05-21 00:33:53 +02:00 committed by GitHub
commit 9d2a0c1245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,13 +82,8 @@ final class BetterStandardPrinter extends Standard
// php attributes
$content = $this->contentPhpAttributePlaceholderReplacer->decorateContent($content);
// remove dead <?php structures
$clearContent = Strings::replace($content, '#\<\?php(\s)\?\>\n?#');
$clearContent = Strings::replace($clearContent, '#\<\?php(\s+)\?\>#');
// keep EOL
return rtrim($clearContent) . $this->nl;
return rtrim($content) . $this->nl;
}
/**