| @@ 576-589 (lines=14) @@ | ||
| 573 | * @return static |
|
| 574 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 575 | */ |
|
| 576 | public function uasort($function): self |
|
| 577 | { |
|
| 578 | if (!\is_callable($function)) { |
|
| 579 | throw new \InvalidArgumentException( |
|
| 580 | 'Passed function must be callable' |
|
| 581 | ); |
|
| 582 | } |
|
| 583 | ||
| 584 | $this->generatorToArray(); |
|
| 585 | ||
| 586 | \uasort($this->array, $function); |
|
| 587 | ||
| 588 | return $this; |
|
| 589 | } |
|
| 590 | ||
| 591 | /** |
|
| 592 | * Sort the entries by keys using a user-defined comparison function. |
|
| @@ 1221-1234 (lines=14) @@ | ||
| 1218 | * @return static |
|
| 1219 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1220 | */ |
|
| 1221 | public function customSortKeys($function): self |
|
| 1222 | { |
|
| 1223 | if (!\is_callable($function)) { |
|
| 1224 | throw new \InvalidArgumentException( |
|
| 1225 | 'Passed function must be callable' |
|
| 1226 | ); |
|
| 1227 | } |
|
| 1228 | ||
| 1229 | $this->generatorToArray(); |
|
| 1230 | ||
| 1231 | \uksort($this->array, $function); |
|
| 1232 | ||
| 1233 | return $this; |
|
| 1234 | } |
|
| 1235 | ||
| 1236 | /** |
|
| 1237 | * Custom sort by value via "usort". |
|
| @@ 1248-1261 (lines=14) @@ | ||
| 1245 | * @return static |
|
| 1246 | * <p>(Mutable) Return this Arrayy object.</p> |
|
| 1247 | */ |
|
| 1248 | public function customSortValues($function): self |
|
| 1249 | { |
|
| 1250 | if (!\is_callable($function)) { |
|
| 1251 | throw new \InvalidArgumentException( |
|
| 1252 | 'Passed function must be callable' |
|
| 1253 | ); |
|
| 1254 | } |
|
| 1255 | ||
| 1256 | $this->generatorToArray(); |
|
| 1257 | ||
| 1258 | \usort($this->array, $function); |
|
| 1259 | ||
| 1260 | return $this; |
|
| 1261 | } |
|
| 1262 | ||
| 1263 | /** |
|
| 1264 | * Return values that are only in the current array. |
|