Merge pull request #3161 from rectorphp/fix-comment-removal

fix comment removal
This commit is contained in:
Tomas Votruba 2020-04-13 12:41:43 +02:00 committed by GitHub
commit d254821f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -366,7 +366,10 @@ final class BetterStandardPrinter extends Standard
private function removeComments(string $printerNode): string
{
// remove /** ... */
$printerNode = Strings::replace($printerNode, '#\/*\*(.*?)\*\/#');
$printerNode = Strings::replace($printerNode, '#\/*\*(.*?)\*\/#s');
// remove /* ... */
$printerNode = Strings::replace($printerNode, '#\/*\*(.*?)\*\/#s');
// remove # ...
$printerNode = Strings::replace($printerNode, '#^(\s+)?\#(.*?)$#m');