diff --git a/src/TicketSwapErrorFormatter.php b/src/TicketSwapErrorFormatter.php index bd91324..72defc1 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)(?=[:]{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 fc3b5e5..d2e1ba9 100644 --- a/tests/TicketSwapErrorFormatterTest.php +++ b/tests/TicketSwapErrorFormatterTest.php @@ -217,6 +217,13 @@ public static function provideHighlight() : iterable null, true ]; + yield [ + 'Property App\Models\ExampleModel::$example_property (stdClass|null) does not accept mixed.', + 'Property App\Models\ExampleModel::$example_property (stdClass|null) does not accept mixed.', + null, + null, + true, + ]; } /**