Commit 1af4ffd2 by Alexander Makarov

Fixes #1056: removed 5.3 compatibiltiy code from ArrayHelper::multisort, fixed phpdoc

parent 1c8d931b
...@@ -336,7 +336,7 @@ class BaseArrayHelper ...@@ -336,7 +336,7 @@ class BaseArrayHelper
* @param boolean|array $descending whether to sort in descending or ascending order. When * @param boolean|array $descending whether to sort in descending or ascending order. When
* sorting by multiple keys with different descending orders, use an array of descending flags. * sorting by multiple keys with different descending orders, use an array of descending flags.
* @param integer|array $sortFlag the PHP sort flag. Valid values include * @param integer|array $sortFlag the PHP sort flag. Valid values include
* `SORT_REGULAR`, `SORT_NUMERIC`, `SORT_STRING` and `SORT_LOCALE_STRING`. * `SORT_REGULAR`, `SORT_NUMERIC`, `SORT_STRING`, `SORT_LOCALE_STRING`, `SORT_NATURAL` and `SORT_FLAG_CASE`.
* Please refer to [PHP manual](http://php.net/manual/en/function.sort.php) * Please refer to [PHP manual](http://php.net/manual/en/function.sort.php)
* for more details. When sorting by multiple keys with different sort flags, use an array of sort flags. * for more details. When sorting by multiple keys with different sort flags, use an array of sort flags.
* @param boolean|array $caseSensitive whether to sort string in case-sensitive manner. This parameter * @param boolean|array $caseSensitive whether to sort string in case-sensitive manner. This parameter
...@@ -372,16 +372,8 @@ class BaseArrayHelper ...@@ -372,16 +372,8 @@ class BaseArrayHelper
$flag = $sortFlag[$i]; $flag = $sortFlag[$i];
$cs = $caseSensitive[$i]; $cs = $caseSensitive[$i];
if (!$cs && ($flag === SORT_STRING)) { if (!$cs && ($flag === SORT_STRING)) {
if (defined('SORT_FLAG_CASE')) { $flag = $flag | SORT_FLAG_CASE;
$flag = $flag | SORT_FLAG_CASE; $args[] = static::getColumn($array, $key);
$args[] = static::getColumn($array, $key);
} else {
$column = [];
foreach (static::getColumn($array, $key) as $k => $value) {
$column[$k] = mb_strtolower($value);
}
$args[] = $column;
}
} else { } else {
$args[] = static::getColumn($array, $key); $args[] = static::getColumn($array, $key);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment