@@ -56,22 +56,22 @@ public function testSupportsWithNativeType(Constraint $constraint, ApiProperty $
56
56
57
57
public static function supportsProvider (): \Generator
58
58
{
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 ];
62
62
yield 'supported positive ' => [new Positive (), (new ApiProperty ())->withBuiltinTypes ([new LegacyType (LegacyType::BUILTIN_TYPE_INT )]), true ];
63
63
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 ];
65
65
}
66
66
67
67
public static function supportsProviderWithNativeType (): \Generator
68
68
{
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 ];
72
72
yield 'native type: supported positive ' => [new Positive (), (new ApiProperty ())->withNativeType (Type::int ()), true ];
73
73
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 ];
75
75
}
76
76
77
77
#[IgnoreDeprecations]
@@ -80,15 +80,15 @@ public function testCreate(): void
80
80
self ::assertEquals ([
81
81
'exclusiveMinimum ' => 10 ,
82
82
'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 )])));
84
84
}
85
85
86
86
public function testCreateWithNativeType (): void
87
87
{
88
88
self ::assertEquals ([
89
89
'exclusiveMinimum ' => 10 ,
90
90
'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 ())));
92
92
93
93
self ::assertEquals ([
94
94
'exclusiveMinimum ' => 0 ,
@@ -98,6 +98,6 @@ public function testCreateWithNativeType(): void
98
98
self ::assertEquals ([
99
99
'exclusiveMinimum ' => 10.99 ,
100
100
'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 ())));
102
102
}
103
103
}
0 commit comments