File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 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
6262 $ typeName ,
6363 static function (Type $ t ) use ($ types ): bool {
6464 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 ;
6975 // The function signature already limits the parameters to stringable types, so there's
7076 // 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+ }
7383
7484 if (!$ subresult ) {
7585 return false ;
You can’t perform that action at this time.
0 commit comments