@@ -76,13 +76,22 @@ public function getTypes(Direction $direction): iterable
7676 // Adds support for the float literal types
7777 yield new Builder \FloatLiteralTypeBuilder ();
7878
79+ // Adds support for the string literal types
80+ yield new Builder \StringLiteralTypeBuilder ();
81+
7982 // Adds support for the "T[]" statement
8083 yield new Builder \TypesListBuilder ();
8184
8285 // Adds support for the "T|U" union types
8386 yield new Builder \UnionTypeBuilder ();
8487
8588 if ($ direction === Direction::Normalize) {
89+ // Adds support for "non-empty-string", "numeric-string" which
90+ // are similar to simple string
91+ yield new Builder \SimpleTypeBuilder (
92+ names: ['non-empty-string ' , 'numeric-string ' ],
93+ type: Type \StringType::class,
94+ );
8695 // Adds support for the "iterable<T> -> list<T>" type
8796 yield new Builder \ListFromIterableTypeBuilder ('list ' , 'mixed ' );
8897 // Adds support for the "object -> array{ ... }" type
@@ -96,6 +105,10 @@ public function getTypes(Direction $direction): iterable
96105 // Adds support for the "object(ClassName) -> array{ ... }" type
97106 yield new Builder \ClassToArrayTypeBuilder ($ this ->meta );
98107 } else {
108+ // Adds support for "non-empty-string"
109+ yield new Builder \SimpleTypeBuilder ('non-empty-string ' , Type \NonEmptyString::class);
110+ // Adds support for "numeric-string"
111+ yield new Builder \SimpleTypeBuilder ('numeric-string ' , Type \NumericString::class);
99112 // Adds support for the "array<T> -> list<T>" type
100113 yield new Builder \ListFromArrayTypeBuilder ('list ' , 'mixed ' );
101114 // Adds support for the "array{ ... } -> object" type
0 commit comments