@@ -89,8 +89,8 @@ protected function _insertBatch(string $table, array $keys, array $values): stri
8989 $ data = implode (
9090 " FROM DUAL UNION ALL \n" ,
9191 array_map (
92- static fn ($ value ) => 'SELECT ' . implode (', ' , array_map (
93- static fn ($ key , $ index ) => $ index . ' ' . $ key ,
92+ static fn ($ value ): string => 'SELECT ' . implode (', ' , array_map (
93+ static fn ($ key , $ index ): string => $ index . ' ' . $ key ,
9494 $ keys ,
9595 $ value
9696 )),
@@ -107,7 +107,7 @@ protected function _insertBatch(string $table, array $keys, array $values): stri
107107 */
108108 protected function _replace (string $ table , array $ keys , array $ values ): string
109109 {
110- $ fieldNames = array_map (static fn ($ columnName ) => trim ($ columnName , '" ' ), $ keys );
110+ $ fieldNames = array_map (static fn ($ columnName ): string => trim ($ columnName , '" ' ), $ keys );
111111
112112 $ uniqueIndexes = array_filter ($ this ->db ->getIndexData ($ table ), static function ($ index ) use ($ fieldNames ): bool {
113113 $ hasAllFields = count (array_intersect ($ index ->fields , $ fieldNames )) === count ($ index ->fields );
@@ -126,24 +126,24 @@ protected function _replace(string $table, array $keys, array $values): string
126126
127127 $ sql = 'MERGE INTO ' . $ table . "\n USING (SELECT " ;
128128
129- $ sql .= implode (', ' , array_map (static fn ($ columnName , $ value ) => $ value . ' ' . $ columnName , $ keys , $ values ));
129+ $ sql .= implode (', ' , array_map (static fn ($ columnName , $ value ): string => $ value . ' ' . $ columnName , $ keys , $ values ));
130130
131131 $ sql .= ' FROM DUAL) "_replace" ON ( ' ;
132132
133133 $ onList = [];
134134 $ onList [] = '1 != 1 ' ;
135135
136136 foreach ($ uniqueIndexes as $ index ) {
137- $ onList [] = '( ' . implode (' AND ' , array_map (static fn ($ columnName ) => $ table . '." ' . $ columnName . '" = "_replace"." ' . $ columnName . '" ' , $ index ->fields )) . ') ' ;
137+ $ onList [] = '( ' . implode (' AND ' , array_map (static fn ($ columnName ): string => $ table . '." ' . $ columnName . '" = "_replace"." ' . $ columnName . '" ' , $ index ->fields )) . ') ' ;
138138 }
139139
140140 $ sql .= implode (' OR ' , $ onList ) . ') WHEN MATCHED THEN UPDATE SET ' ;
141141
142- $ sql .= implode (', ' , array_map (static fn ($ columnName ) => $ columnName . ' = "_replace". ' . $ columnName , $ replaceableFields ));
142+ $ sql .= implode (', ' , array_map (static fn ($ columnName ): string => $ columnName . ' = "_replace". ' . $ columnName , $ replaceableFields ));
143143
144144 $ sql .= ' WHEN NOT MATCHED THEN INSERT ( ' . implode (', ' , $ replaceableFields ) . ') VALUES ' ;
145145
146- return $ sql . (' ( ' . implode (', ' , array_map (static fn ($ columnName ) => '"_replace". ' . $ columnName , $ replaceableFields )) . ') ' );
146+ return $ sql . (' ( ' . implode (', ' , array_map (static fn ($ columnName ): string => '"_replace". ' . $ columnName , $ replaceableFields )) . ') ' );
147147 }
148148
149149 /**
@@ -298,7 +298,7 @@ protected function _updateBatch(string $table, array $keys, array $values): stri
298298 $ sql .= implode (
299299 ", \n" ,
300300 array_map (
301- static fn ($ key , $ value ) => $ table . '. ' . $ key . ($ value instanceof RawSql ?
301+ static fn ($ key , $ value ): string => $ table . '. ' . $ key . ($ value instanceof RawSql ?
302302 ' = ' . $ value :
303303 ' = ' . $ alias . '. ' . $ value ),
304304 array_keys ($ updateFields ),
@@ -315,8 +315,8 @@ protected function _updateBatch(string $table, array $keys, array $values): stri
315315 $ data = implode (
316316 " UNION ALL \n" ,
317317 array_map (
318- static fn ($ value ) => 'SELECT ' . implode (', ' , array_map (
319- static fn ($ key , $ index ) => $ index . ' ' . $ key ,
318+ static fn ($ value ): string => 'SELECT ' . implode (', ' , array_map (
319+ static fn ($ key , $ index ): string => $ index . ' ' . $ key ,
320320 $ keys ,
321321 $ value
322322 )) . ' FROM DUAL ' ,
@@ -342,7 +342,7 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
342342 $ constraints = $ this ->QBOptions ['constraints ' ] ?? [];
343343
344344 if (empty ($ constraints )) {
345- $ fieldNames = array_map (static fn ($ columnName ) => trim ($ columnName , '" ' ), $ keys );
345+ $ fieldNames = array_map (static fn ($ columnName ): string => trim ($ columnName , '" ' ), $ keys );
346346
347347 $ uniqueIndexes = array_filter ($ this ->db ->getIndexData ($ table ), static function ($ index ) use ($ fieldNames ): bool {
348348 $ hasAllFields = count (array_intersect ($ index ->fields , $ fieldNames )) === count ($ index ->fields );
@@ -401,7 +401,7 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
401401 $ sql .= implode (
402402 ", \n" ,
403403 array_map (
404- static fn ($ key , $ value ) => $ key . ($ value instanceof RawSql ?
404+ static fn ($ key , $ value ): string => $ key . ($ value instanceof RawSql ?
405405 " = {$ value }" :
406406 " = {$ alias }. {$ value }" ),
407407 array_keys ($ updateFields ),
@@ -412,7 +412,7 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
412412 $ sql .= "\nWHEN NOT MATCHED THEN INSERT ( " . implode (', ' , $ keys ) . ") \nVALUES " ;
413413
414414 $ sql .= (' ( '
415- . implode (', ' , array_map (static fn ($ columnName ) => "{$ alias }. {$ columnName }" , $ keys ))
415+ . implode (', ' , array_map (static fn ($ columnName ): string => "{$ alias }. {$ columnName }" , $ keys ))
416416 . ') ' );
417417
418418 $ this ->QBOptions ['sql ' ] = $ sql ;
@@ -424,8 +424,8 @@ protected function _upsertBatch(string $table, array $keys, array $values): stri
424424 $ data = implode (
425425 " FROM DUAL UNION ALL \n" ,
426426 array_map (
427- static fn ($ value ) => 'SELECT ' . implode (', ' , array_map (
428- static fn ($ key , $ index ) => $ index . ' ' . $ key ,
427+ static fn ($ value ): string => 'SELECT ' . implode (', ' , array_map (
428+ static fn ($ key , $ index ): string => $ index . ' ' . $ key ,
429429 $ keys ,
430430 $ value
431431 )),
@@ -503,8 +503,8 @@ protected function _deleteBatch(string $table, array $keys, array $values): stri
503503 $ data = implode (
504504 " FROM DUAL UNION ALL \n" ,
505505 array_map (
506- static fn ($ value ) => 'SELECT ' . implode (', ' , array_map (
507- static fn ($ key , $ index ) => $ index . ' ' . $ key ,
506+ static fn ($ value ): string => 'SELECT ' . implode (', ' , array_map (
507+ static fn ($ key , $ index ): string => $ index . ' ' . $ key ,
508508 $ keys ,
509509 $ value
510510 )),
0 commit comments