|
20 | 20 | UuidType, |
21 | 21 | XMLElementType, |
22 | 22 | XMLType}; |
| 23 | +use Flow\Types\Type\Logical\HTMLType; |
23 | 24 | use Flow\Types\Type\Native\{BooleanType, EnumType, FloatType, IntegerType, StringType}; |
24 | 25 |
|
25 | 26 | final readonly class PHPSchemaFormatter implements SchemaFormatter |
@@ -114,6 +115,7 @@ private function formatSchema(Schema $schema, int $level = 1) : string |
114 | 115 | TimeType::class, |
115 | 116 | JsonType::class, |
116 | 117 | UuidType::class, |
| 118 | + HTMLType::class, |
117 | 119 | XMLType::class, |
118 | 120 | XMLElementType::class, |
119 | 121 | DateTimeType::class => $this->simpleType($definition), |
@@ -174,16 +176,17 @@ private function mapType(Definition $definition) : string |
174 | 176 | private function simpleType(Definition $definition) : string |
175 | 177 | { |
176 | 178 | $reflection = match ($definition->type()::class) { |
177 | | - StringType::class => new \ReflectionFunction("\Flow\ETL\DSL\string_schema"), |
178 | | - IntegerType::class => new \ReflectionFunction("\Flow\ETL\DSL\integer_schema"), |
179 | | - BooleanType::class => new \ReflectionFunction("\Flow\ETL\DSL\bool_schema"), |
180 | | - DateType::class => new \ReflectionFunction("\Flow\ETL\DSL\date_schema"), |
181 | | - DateTimeType::class => new \ReflectionFunction("\Flow\ETL\DSL\datetime_schema"), |
182 | | - TimeType::class => new \ReflectionFunction("\Flow\ETL\DSL\\time_schema"), |
183 | | - JsonType::class => new \ReflectionFunction("\Flow\ETL\DSL\\json_schema"), |
184 | | - UuidType::class => new \ReflectionFunction("\Flow\ETL\DSL\\uuid_schema"), |
185 | | - XMLType::class => new \ReflectionFunction("\Flow\ETL\DSL\\xml_schema"), |
186 | | - XMLElementType::class => new \ReflectionFunction("\Flow\ETL\DSL\\xml_element_schema"), |
| 179 | + StringType::class => new \ReflectionFunction('\Flow\ETL\DSL\string_schema'), |
| 180 | + IntegerType::class => new \ReflectionFunction('\Flow\ETL\DSL\integer_schema'), |
| 181 | + BooleanType::class => new \ReflectionFunction('\Flow\ETL\DSL\bool_schema'), |
| 182 | + DateType::class => new \ReflectionFunction('\Flow\ETL\DSL\date_schema'), |
| 183 | + DateTimeType::class => new \ReflectionFunction('\Flow\ETL\DSL\datetime_schema'), |
| 184 | + TimeType::class => new \ReflectionFunction('\Flow\ETL\DSL\time_schema'), |
| 185 | + JsonType::class => new \ReflectionFunction('\Flow\ETL\DSL\json_schema'), |
| 186 | + UuidType::class => new \ReflectionFunction('\Flow\ETL\DSL\uuid_schema'), |
| 187 | + XMLType::class => new \ReflectionFunction('\Flow\ETL\DSL\xml_schema'), |
| 188 | + XMLElementType::class => new \ReflectionFunction('\Flow\ETL\DSL\xml_element_schema'), |
| 189 | + HTMLType::class => new \ReflectionFunction('\Flow\ETL\DSL\html_schema'), |
187 | 190 | default => throw new RuntimeException('Type ' . $definition->type()->toString() . ' is not a simple definition'), |
188 | 191 | }; |
189 | 192 |
|
|
0 commit comments