@@ -56,22 +56,22 @@ public function testSupportsWithNativeType(Constraint $constraint, ApiProperty $
5656
5757 public static function supportsProvider (): \Generator
5858 {
59- yield 'supported int/float with union types ' => [new GreaterThan ([ ' value ' => 10 ] ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT ), new LegacyType (LegacyType::BUILTIN_TYPE_FLOAT )]), true ];
60- yield 'supported int ' => [new GreaterThan ([ ' value ' => 10 ] ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT )]), true ];
61- yield 'supported float ' => [new GreaterThan ([ ' value ' => 10.99 ] ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_FLOAT )]), true ];
59+ yield 'supported int/float with union types ' => [new GreaterThan (value: 10 ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT ), new LegacyType (LegacyType::BUILTIN_TYPE_FLOAT )]), true ];
60+ yield 'supported int ' => [new GreaterThan (value: 10 ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT )]), true ];
61+ yield 'supported float ' => [new GreaterThan (value: 10.99 ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_FLOAT )]), true ];
6262 yield 'supported positive ' => [new Positive (), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT )]), true ];
6363 yield 'not supported positive or zero ' => [new PositiveOrZero (), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT )]), false ];
64- yield 'not supported property path ' => [new GreaterThan ([ ' propertyPath ' => 'greaterThanMe ' ] ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT )]), false ];
64+ yield 'not supported property path ' => [new GreaterThan (propertyPath: 'greaterThanMe ' ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT )]), false ];
6565 }
6666
6767 public static function supportsProviderWithNativeType (): \Generator
6868 {
69- yield 'native type: supported int/float with union types ' => [new GreaterThan ([ ' value ' => 10 ] ), (new ApiProperty ())->withNativeType (Type::union (Type::int (), Type::float ())), true ];
70- yield 'native type: supported int ' => [new GreaterThan ([ ' value ' => 10 ] ), (new ApiProperty ())->withNativeType (Type::int ()), true ];
71- yield 'native type: supported float ' => [new GreaterThan ([ ' value ' => 10.99 ] ), (new ApiProperty ())->withNativeType (Type::float ()), true ];
69+ yield 'native type: supported int/float with union types ' => [new GreaterThan (value: 10 ), (new ApiProperty ())->withNativeType (Type::union (Type::int (), Type::float ())), true ];
70+ yield 'native type: supported int ' => [new GreaterThan (value: 10 ), (new ApiProperty ())->withNativeType (Type::int ()), true ];
71+ yield 'native type: supported float ' => [new GreaterThan (value: 10.99 ), (new ApiProperty ())->withNativeType (Type::float ()), true ];
7272 yield 'native type: supported positive ' => [new Positive (), (new ApiProperty ())->withNativeType (Type::int ()), true ];
7373 yield 'native type: not supported positive or zero ' => [new PositiveOrZero (), (new ApiProperty ())->withNativeType (Type::int ()), false ];
74- yield 'native type: not supported property path ' => [new GreaterThan ([ ' propertyPath ' => 'greaterThanMe ' ] ), (new ApiProperty ())->withNativeType (Type::int ()), false ];
74+ yield 'native type: not supported property path ' => [new GreaterThan (propertyPath: 'greaterThanMe ' ), (new ApiProperty ())->withNativeType (Type::int ()), false ];
7575 }
7676
7777 #[IgnoreDeprecations]
@@ -80,15 +80,15 @@ public function testCreate(): void
8080 self ::assertEquals ([
8181 'exclusiveMinimum ' => 10 ,
8282 'minimum ' => 10 ,
83- ], $ this ->propertySchemaGreaterThanRestriction ->create (new GreaterThan ([ ' value ' => 10 ] ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT )])));
83+ ], $ this ->propertySchemaGreaterThanRestriction ->create (new GreaterThan (value: 10 ), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT )])));
8484 }
8585
8686 public function testCreateWithNativeType (): void
8787 {
8888 self ::assertEquals ([
8989 'exclusiveMinimum ' => 10 ,
9090 'minimum ' => 10 ,
91- ], $ this ->propertySchemaGreaterThanRestriction ->create (new GreaterThan ([ ' value ' => 10 ] ), (new ApiProperty ())->withNativeType (Type::int ())));
91+ ], $ this ->propertySchemaGreaterThanRestriction ->create (new GreaterThan (value: 10 ), (new ApiProperty ())->withNativeType (Type::int ())));
9292
9393 self ::assertEquals ([
9494 'exclusiveMinimum ' => 0 ,
@@ -98,6 +98,6 @@ public function testCreateWithNativeType(): void
9898 self ::assertEquals ([
9999 'exclusiveMinimum ' => 10.99 ,
100100 'minimum ' => 10.99 ,
101- ], $ this ->propertySchemaGreaterThanRestriction ->create (new GreaterThan ([ ' value ' => 10.99 ] ), (new ApiProperty ())->withNativeType (Type::float ())));
101+ ], $ this ->propertySchemaGreaterThanRestriction ->create (new GreaterThan (value: 10.99 ), (new ApiProperty ())->withNativeType (Type::float ())));
102102 }
103103}
0 commit comments