From a63c949a5522a8fdeae2dfa77bb39565727f7a0a Mon Sep 17 00:00:00 2001 From: wn_ Date: Fri, 12 Aug 2022 14:41:21 +0000 Subject: Use arrow functions in some places. --- classes/db/migrations.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'classes/db') diff --git a/classes/db/migrations.php b/classes/db/migrations.php index 5f969c513..ffce2af5f 100644 --- a/classes/db/migrations.php +++ b/classes/db/migrations.php @@ -189,14 +189,11 @@ class Db_Migrations { $filename = "{$this->base_path}/{$this->base_filename}"; if (file_exists($filename)) { - $lines = array_filter(preg_split("/[\r\n]/", file_get_contents($filename)), - function ($line) { - return strlen(trim($line)) > 0 && strpos($line, "--") !== 0; - }); - - return array_filter(explode(";", implode("", $lines)), function ($line) { - return strlen(trim($line)) > 0 && !in_array(strtolower($line), ["begin", "commit"]); - }); + $lines = array_filter(preg_split("/[\r\n]/", file_get_contents($filename)), + fn($line) => strlen(trim($line)) > 0 && strpos($line, "--") !== 0); + + return array_filter(explode(";", implode("", $lines)), + fn($line) => strlen(trim($line)) > 0 && !in_array(strtolower($line), ["begin", "commit"])); } else { user_error("Requested schema file ${filename} not found.", E_USER_ERROR); -- cgit v1.2.3-54-g00ecf