From e1bf45aa8020a801a553768d081a7e8948ceffd6 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Dec 2021 21:42:19 +0100 Subject: [PATCH] Fix issue parsing php files with unterminated comments found inside backticks, fixes #10385 --- src/Composer/Autoload/PhpFileCleaner.php | 1 + .../Test/Autoload/Fixtures/classmap/sameNsMultipleClasses.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/Composer/Autoload/PhpFileCleaner.php b/src/Composer/Autoload/PhpFileCleaner.php index 2564973fc..190d518a6 100644 --- a/src/Composer/Autoload/PhpFileCleaner.php +++ b/src/Composer/Autoload/PhpFileCleaner.php @@ -120,6 +120,7 @@ class PhpFileCleaner } if ($this->peek('*')) { $this->skipComment(); + continue; } } diff --git a/tests/Composer/Test/Autoload/Fixtures/classmap/sameNsMultipleClasses.php b/tests/Composer/Test/Autoload/Fixtures/classmap/sameNsMultipleClasses.php index f92ae8be4..efd3f1c11 100644 --- a/tests/Composer/Test/Autoload/Fixtures/classmap/sameNsMultipleClasses.php +++ b/tests/Composer/Test/Autoload/Fixtures/classmap/sameNsMultipleClasses.php @@ -4,3 +4,5 @@ namespace Foo\Bar; class A {} class B {} + +$x = `/** unterminated comment`;