Skip to content

Commit

Permalink
Merge pull request #120 from wdammak/patch-16
Browse files Browse the repository at this point in the history
Update Tools.php
  • Loading branch information
rohit053 authored Oct 27, 2020
2 parents 7b82227 + 829176f commit 4071a68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 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,7 +3733,7 @@ public static function spreadAmount($amount, $precision, &$rows, $column)
return;
}

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

uasort($rows, $sort_function);

Expand Down

0 comments on commit 4071a68

Please sign in to comment.