@@ -79,11 +79,8 @@ protected function getCheckMethod(): CodegenMethod {
7979 private function generateNotChecks (vec <TSchema > $schemas , HackBuilder $hb ): void {
8080 $constraints = vec [];
8181 foreach ($schemas as $index => $schema ) {
82- $schema_builder = new SchemaBuilder (
83- $this -> ctx ,
84- $this -> generateClassName($this -> suffix , ' not' , (string )$index ),
85- $schema ,
86- );
82+ $schema_builder =
83+ new SchemaBuilder ($this -> ctx , $this -> generateClassName($this -> suffix , ' not' , (string )$index ), $schema );
8784 $schema_builder -> build();
8885 $constraints [] = " {$schema_builder->getClassName()} ::check<>" ;
8986 }
@@ -134,11 +131,8 @@ private function generateNotChecks(vec<TSchema> $schemas, HackBuilder $hb): void
134131 private function generateOneOfChecks (vec <TSchema > $schemas , HackBuilder $hb ): void {
135132 $constraints = vec [];
136133 foreach ($schemas as $index => $schema ) {
137- $schema_builder = new SchemaBuilder (
138- $this -> ctx ,
139- $this -> generateClassName($this -> suffix , ' oneOf' , (string )$index ),
140- $schema ,
141- );
134+ $schema_builder =
135+ new SchemaBuilder ($this -> ctx , $this -> generateClassName($this -> suffix , ' oneOf' , (string )$index ), $schema );
142136 $schema_builder -> build();
143137 $constraints [] = " {$schema_builder->getClassName()} ::check<>" ;
144138 }
@@ -220,11 +214,8 @@ public function getMergedAllOfChecks(): ?TSchema {
220214 $schemas = $this -> typed_schema [' allOf' ] ?? vec []
221215 |> Vec \reverse ($$); // Reverse for parity with non-strict output; this shouldn't actually matter.
222216 foreach ($schemas as $index => $schema ) {
223- $schema_builder = new SchemaBuilder (
224- $this -> ctx ,
225- $this -> generateClassName($this -> suffix , ' allOf' , (string )$index ),
226- $schema
227- );
217+ $schema_builder =
218+ new SchemaBuilder ($this -> ctx , $this -> generateClassName($this -> suffix , ' allOf' , (string )$index ), $schema );
228219 $schema = $schema_builder -> getResolvedSchema();
229220 if (Shapes :: keyExists($schema , ' allOf' )) {
230221 $builder = new UntypedBuilder ($this -> ctx , ' allOf' , $schema );
@@ -294,15 +285,13 @@ public function getMergedAllOfChecks(): ?TSchema {
294285 |> Vec \unique ($$);
295286
296287 if (Shapes :: keyExists($schema , ' minProperties' )) {
297- $min_properties = $min_properties is null
298- ? $schema [' minProperties' ]
299- : Math \maxva ($min_properties , $schema [' minProperties' ]);
288+ $min_properties =
289+ $min_properties is null ? $schema [' minProperties' ] : Math \maxva ($min_properties , $schema [' minProperties' ]);
300290 }
301291
302292 if (Shapes :: keyExists($schema , ' maxProperties' )) {
303- $max_properties = $max_properties is null
304- ? $schema [' maxProperties' ]
305- : Math \minva ($max_properties , $schema [' maxProperties' ]);
293+ $max_properties =
294+ $max_properties is null ? $schema [' maxProperties' ] : Math \minva ($max_properties , $schema [' maxProperties' ]);
306295 }
307296
308297 $coerce = $coerce || Shapes :: idx($schema , ' coerce' , false );
@@ -331,11 +320,7 @@ public function getMergedAllOfChecks(): ?TSchema {
331320 }
332321
333322 private function generateMergedAllOfChecks (TSchema $schema , HackBuilder $hb ): void {
334- $schema_builder = new SchemaBuilder (
335- $this -> ctx ,
336- $this -> generateClassName($this -> suffix , ' allOf' ),
337- $schema
338- );
323+ $schema_builder = new SchemaBuilder ($this -> ctx , $this -> generateClassName($this -> suffix , ' allOf' ), $schema );
339324 $schema_builder -> build();
340325 $this -> current_type = $schema_builder -> getType();
341326 $hb -> addReturnf(' %s::check($input, $pointer)' , $schema_builder -> getClassName());
@@ -344,11 +329,8 @@ private function generateMergedAllOfChecks(TSchema $schema, HackBuilder $hb): vo
344329 private function generateMixedAllOfChecks (vec <TSchema > $schemas , HackBuilder $hb ): void {
345330 $constraints = vec [];
346331 foreach ($schemas as $index => $schema ) {
347- $schema_builder = new SchemaBuilder (
348- $this -> ctx ,
349- $this -> generateClassName($this -> suffix , ' allOf' , (string )$index ),
350- $schema ,
351- );
332+ $schema_builder =
333+ new SchemaBuilder ($this -> ctx , $this -> generateClassName($this -> suffix , ' allOf' , (string )$index ), $schema );
352334 $schema_builder -> build();
353335 $constraints [] = " {$schema_builder->getClassName()} ::check<>" ;
354336 }
@@ -454,10 +436,8 @@ private function getOptimizedAnyOfTypes(vec<SchemaBuilder> $schema_builders): ?T
454436 $property_type = TSchemaType :: assert($property_type );
455437
456438 if ($property_type === TSchemaType :: STRING_T && C \contains ($required , $property_name )) {
457- $typed_property_schema = type_assert_shape (
458- $property_schema ,
459- ' Slack\Hack\JsonSchema\Codegen\TStringSchema' ,
460- );
439+ $typed_property_schema =
440+ type_assert_shape ($property_schema , ' Slack\Hack\JsonSchema\Codegen\TStringSchema' );
461441
462442 $enum = $typed_property_schema [' enum' ] ?? null ;
463443 if ($enum is nonnull && C \count ($enum ) === 1 ) {
0 commit comments