Skip to content

Commit

Permalink
Update Tools.php
Browse files Browse the repository at this point in the history
PHP 7.2 & 7.3
  • Loading branch information
wdammak authored Sep 28, 2020
1 parent 3e3dc9f commit b9d4a19
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions classes/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ public static function toCamelCase($str, $catapitalise_first_char = false)
if ($catapitalise_first_char) {
$str = Tools::ucfirst($str);
}
return preg_replace_callback('/_+([a-z])/', create_function('$c', 'return strtoupper($c[1]);'), $str);
return preg_replace_callback('/_+([a-z])/', function ($c) { return strtoupper($c[1]); }, $str);
}

/**
Expand Down Expand Up @@ -3733,9 +3733,7 @@ public static function spreadAmount($amount, $precision, &$rows, $column)
return;
}

$sort_function = create_function('$a, $b', "return \$b['$column'] > \$a['$column'] ? 1 : -1;");

uasort($rows, $sort_function);
uasort($rows, function ($a, $b) { return $b['$column'] > $a['$column'] ? 1 : -1; });

$unit = pow(10, $precision);

Expand Down

0 comments on commit b9d4a19

Please sign in to comment.