From bada68af7cb6efe88961c4bc6b33367d13c86ca4 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Thu, 6 Apr 2023 09:33:22 +0200 Subject: [PATCH] Object shapes - test without space after colon --- tests/PHPStan/Parser/TypeParserTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/PHPStan/Parser/TypeParserTest.php b/tests/PHPStan/Parser/TypeParserTest.php index ed5d725a..0549ec4a 100644 --- a/tests/PHPStan/Parser/TypeParserTest.php +++ b/tests/PHPStan/Parser/TypeParserTest.php @@ -1860,6 +1860,21 @@ public function provideParseData(): array 'int|object{}', new UnionTypeNode([new IdentifierTypeNode('int'), new ObjectShapeNode([])]), ], + [ + 'object{attribute:string, value?:string}', + new ObjectShapeNode([ + new ObjectShapeItemNode( + new IdentifierTypeNode('attribute'), + false, + new IdentifierTypeNode('string') + ), + new ObjectShapeItemNode( + new IdentifierTypeNode('value'), + true, + new IdentifierTypeNode('string') + ), + ]), + ], ]; }