diff --git a/src/TicketSwapErrorFormatter.php b/src/TicketSwapErrorFormatter.php index f488bfe..3884b35 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|array|object|mixed|resource|iterable|void|callable)(?=[:]{2}|[\.\s\|><,\(\)\{\}]+)/', + '/(?<=[\s\|\(><])(null|true|false|int|float|bool|([-\w]+-)?string|Stringable|array|object|mixed|resource|iterable|void|callable)(?=[:]{2}|[\.\s\|><,\(\)\{\}]+)/', '$1', $message, ); diff --git a/tests/TicketSwapErrorFormatterTest.php b/tests/TicketSwapErrorFormatterTest.php index 3f374bb..cb2984c 100644 --- a/tests/TicketSwapErrorFormatterTest.php +++ b/tests/TicketSwapErrorFormatterTest.php @@ -203,6 +203,13 @@ public static function provideHighlight() : iterable 'argument.type', true ]; + yield [ + 'Parameter #1 $currentWorkingDirectory of method Application\AnalyzeCommand: getFinder() expects string, Stringable|false given.', + 'Parameter #1 $currentWorkingDirectory of method Application\AnalyzeCommand: getFinder() expects string, Stringable|false given.', + null, + null, + true + ]; } /**