diff --git a/src/TicketSwapErrorFormatter.php b/src/TicketSwapErrorFormatter.php index 4b8d994..f488bfe 100644 --- a/src/TicketSwapErrorFormatter.php +++ b/src/TicketSwapErrorFormatter.php @@ -224,7 +224,7 @@ public static function highlight(string $message, ?string $tip, ?string $identif // Variable $message = (string) preg_replace( - "/(?<=[:]{2}|[\s\"\(])([.]{3})?(\\$[A-Za-z0-9_\\-]+)(?=[\s|\"|\)]|$)/", + "/(?<=[:]{2}|[\s\"\(])([.]{3})?(\\$[A-Za-z0-9_\\-]+)(?=[\.|\s|\"|\)]|$)/", '$1$2', $message, ); diff --git a/tests/TicketSwapErrorFormatterTest.php b/tests/TicketSwapErrorFormatterTest.php index 2686e29..3f374bb 100644 --- a/tests/TicketSwapErrorFormatterTest.php +++ b/tests/TicketSwapErrorFormatterTest.php @@ -182,6 +182,13 @@ public static function provideHighlight() : iterable null, true ]; + yield [ + "Parameter #1 \$currentWorkingDirectory.", + 'Parameter #1 $currentWorkingDirectory.', + null, + null, + true + ]; yield [ 'Parameter #1 $currentWorkingDirectory of method Application\AnalyzeCommand: getFinder() expects string, string|false given.', 'Parameter #1 $currentWorkingDirectory of method Application\AnalyzeCommand: getFinder() expects string, string|false given.',