File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -62,14 +62,24 @@ public function getPrintfPlaceholderAcceptingTypes(string $format): array
62
62
$ typeName ,
63
63
static function (Type $ t ) use ($ types ): bool {
64
64
foreach ($ types as $ acceptingType ) {
65
- $ subresult = match ($ acceptingType ) {
66
- 'strict-int ' => (new IntegerType ())->accepts ($ t , true )->yes (),
67
- 'int ' => ! $ t ->toInteger () instanceof ErrorType,
68
- 'float ' => ! $ t ->toFloat () instanceof ErrorType,
65
+ switch ($ acceptingType ) {
66
+ case 'strict-int ' :
67
+ $ subresult = (new IntegerType ())->accepts ($ t , true )->yes ();
68
+ break ;
69
+ case 'int ' :
70
+ $ subresult = ! $ t ->toInteger () instanceof ErrorType;
71
+ break ;
72
+ case 'float ' :
73
+ $ subresult = ! $ t ->toFloat () instanceof ErrorType;
74
+ break ;
69
75
// The function signature already limits the parameters to stringable types, so there's
70
76
// no point in checking string again here.
71
- 'string ' , 'mixed ' => true ,
72
- };
77
+ case 'string ' :
78
+ case 'mixed ' :
79
+ default :
80
+ $ subresult = true ;
81
+ break ;
82
+ }
73
83
74
84
if (!$ subresult ) {
75
85
return false ;
You can’t perform that action at this time.
0 commit comments