| @@ 289-298 (lines=10) @@ | ||
| 286 | return []; |
|
| 287 | } |
|
| 288 | if ($this->sortType == self::SORT_TYPE_LENGTH) { |
|
| 289 | usort($group, function ($a, $b) { |
|
| 290 | $cmp = strlen($b) - strlen($a); |
|
| 291 | if ($cmp === 0) { |
|
| 292 | $a = strtolower($a); |
|
| 293 | $b = strtolower($b); |
|
| 294 | $cmp = strcmp($b, $a); |
|
| 295 | } |
|
| 296 | ||
| 297 | return $cmp; |
|
| 298 | }); |
|
| 299 | } elseif ($this->sortType == self::SORT_TYPE_ALPHABETIC) { |
|
| 300 | usort($group, function ($a, $b) { |
|
| 301 | $a = strtolower($a); |
|
| @@ 300-309 (lines=10) @@ | ||
| 297 | return $cmp; |
|
| 298 | }); |
|
| 299 | } elseif ($this->sortType == self::SORT_TYPE_ALPHABETIC) { |
|
| 300 | usort($group, function ($a, $b) { |
|
| 301 | $a = strtolower($a); |
|
| 302 | $b = strtolower($b); |
|
| 303 | $cmp = strcmp($b, $a); |
|
| 304 | if ($cmp === 0) { |
|
| 305 | $cmp = strlen($b) - strlen($a); |
|
| 306 | } |
|
| 307 | ||
| 308 | return $cmp; |
|
| 309 | }); |
|
| 310 | } |
|
| 311 | if ($this->sortDirection == self::SORT_DIRECTION_ASC) { |
|
| 312 | $group = array_reverse($group); |
|