diff --git a/src/TicketSwapErrorFormatter.php b/src/TicketSwapErrorFormatter.php index 72defc1..ca502c7 100644 --- a/src/TicketSwapErrorFormatter.php +++ b/src/TicketSwapErrorFormatter.php @@ -245,7 +245,7 @@ public static function highlight(string $message, ?string $tip, ?string $identif // Types $message = (string) preg_replace( - '/(?<=[\s\|\(><])(null|true|false|int|float|bool|([-\w]+-)?string|Stringable|array|object|mixed|resource|iterable|void|callable|stdClass)(?=[:]{2}|[\.\s\|><,\(\)\{\}]+)/', + '/(?<=[\s\|\(><,])(null|true|false|int|float|bool|([-\w]+-)?string|Stringable|array|object|mixed|resource|iterable|void|callable|stdClass)(?=[:]{2}|[\.\s\|><,\(\)\{\}]+)/', '$1', $message, ); diff --git a/tests/TicketSwapErrorFormatterTest.php b/tests/TicketSwapErrorFormatterTest.php index d2e1ba9..08a4aa3 100644 --- a/tests/TicketSwapErrorFormatterTest.php +++ b/tests/TicketSwapErrorFormatterTest.php @@ -224,6 +224,13 @@ public static function provideHighlight() : iterable null, true, ]; + yield [ + 'Parameter #1 $callback of method Illuminate\Support\Collection<int,mixed>::map() expects', + 'Parameter #1 $callback of method Illuminate\Support\Collection::map() expects', + null, + null, + true, + ]; } /**