Skip to content

Commit bb60ad1

Browse files
committed
Refactor escapeAll()
Signed-off-by: Kamil Tekiela <[email protected]>
1 parent 0b21c5c commit bb60ad1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Context.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use PhpMyAdmin\SqlParser\Contexts\ContextMySql50700;
88

9+
use function array_map;
910
use function class_exists;
1011
use function explode;
1112
use function in_array;
@@ -672,11 +673,7 @@ public static function escape(string $str, string $quote = '`'): string
672673
*/
673674
public static function escapeAll(array $strings): array
674675
{
675-
foreach ($strings as $key => $value) {
676-
$strings[$key] = static::escape($value);
677-
}
678-
679-
return $strings;
676+
return array_map(static::escape(...), $strings);
680677
}
681678

682679
/**

0 commit comments

Comments
 (0)