From 399a297c386ad132efeeda2a5556b11914b5199f Mon Sep 17 00:00:00 2001 From: Simon Bigelmayr Date: Wed, 24 Sep 2025 11:01:45 +0200 Subject: [PATCH 1/3] add stdClass as type --- src/TicketSwapErrorFormatter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, ); From 4100d3b81d0175175dab243326ec11cdc080e1d2 Mon Sep 17 00:00:00 2001 From: Simon Bigelmayr Date: Wed, 24 Sep 2025 11:17:06 +0200 Subject: [PATCH 2/3] add missing testcase for stdClass --- tests/TicketSwapErrorFormatterTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/TicketSwapErrorFormatterTest.php b/tests/TicketSwapErrorFormatterTest.php index fc3b5e5..a1e2085 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, + ]; } /** From adb8336c1413862751e3d9fb99fd13adba06a2f7 Mon Sep 17 00:00:00 2001 From: Simon Bigelmayr Date: Wed, 24 Sep 2025 11:19:27 +0200 Subject: [PATCH 3/3] fix test --- tests/TicketSwapErrorFormatterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TicketSwapErrorFormatterTest.php b/tests/TicketSwapErrorFormatterTest.php index a1e2085..d2e1ba9 100644 --- a/tests/TicketSwapErrorFormatterTest.php +++ b/tests/TicketSwapErrorFormatterTest.php @@ -218,7 +218,7 @@ public static function provideHighlight() : iterable 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.', 'Property App\Models\ExampleModel::$example_property (stdClass|null) does not accept mixed.', null, null,