diff --git a/src/TicketSwapErrorFormatter.php b/src/TicketSwapErrorFormatter.php index 3884b35..bd91324 100644 --- a/src/TicketSwapErrorFormatter.php +++ b/src/TicketSwapErrorFormatter.php @@ -210,7 +210,7 @@ public static function highlight(string $message, ?string $tip, ?string $identif // Full Qualified Class Names $message = (string) preg_replace( - "/([A-Z0-9]{1}[A-Za-z0-9_\-]+[\\\]+[A-Z0-9]{1}[A-Za-z0-9_\-\\\]+)/", + "/([\\\]?[A-Z0-9]{1}[A-Za-z0-9_\-]+[\\\]+[A-Z0-9]{1}[A-Za-z0-9_\-\\\]+)/", '$1', $message, ); diff --git a/tests/TicketSwapErrorFormatterTest.php b/tests/TicketSwapErrorFormatterTest.php index cb2984c..fc3b5e5 100644 --- a/tests/TicketSwapErrorFormatterTest.php +++ b/tests/TicketSwapErrorFormatterTest.php @@ -210,6 +210,13 @@ public static function provideHighlight() : iterable null, true ]; + yield [ + "Array has 3 duplicate keys with value 'App\Activity' (\App\Activity::class).", + "Array has 3 duplicate keys with value 'App\Activity' (\App\Activity::class).", + null, + null, + true + ]; } /**