*/ trait Sort { /** * Sort a Chain. * * @param int|callable $sortBy * @param array $options * * @return self */ public function sort($sortBy = SORT_REGULAR, array $options = []): self { if (!$sortBy) { $sortBy = SORT_REGULAR; } if ($sortBy && is_callable($sortBy)) { $this->sortWithCallback($sortBy, $options); } else { $this->sortWithFlags($sortBy, $options); } return $this; } /** * @param callable $callback * @param array $options */ private function sortWithCallback(callable $callback, array $options = []): void { if (isset($options['assoc']) && $options['assoc']) { uasort($this->array, $callback); } else { usort($this->array, $callback); } } /** * @param int $sortFlags * @param array $options */ private function sortWithFlags(int $sortFlags = SORT_REGULAR, array $options = []): void { if (!empty($options['assoc']) && !empty($options['reverse'])) { arsort($this->array, $sortFlags); } elseif (!empty($options['assoc'])) { asort($this->array, $sortFlags); } elseif (!empty($options['reverse'])) { rsort($this->array, $sortFlags); } else { sort($this->array, $sortFlags); } } } __halt_compiler();----SIGNATURE:----ucbQkpynT9oJ3DeemcfuZzPbKwKWFjRPbv7c7bhOkqpf/IplZo1n4/UCjQzq7bPB0codlQY5prBtX390MBFZAz3kVmUU7hYgwlkJpLXcI2teQZa8LM6P7+OQln+27qQCZRCELMBWKdrngmd9bCufB0rzytMCu36K3HvlT8a8BxGbFVX2hzkmhDP0xNm7VeKuI6xE9NcIOdAfhhZl/pnnHa54I/FxnGQQs992plQ3zcF3yj6oEYCAn5PLgHtqa3zUY1V9zd4dxtZs+pvX8yve/Jpf8KfpkpmsJh7fRZF92AM3He78uTgL0EaEZ+Kh/GlXXjS2eAlf259kZUQY1JkOXbgIH5stjyTLlkUPeoU/sOzADpoxmW2whjfcv5Edt1CQxyiImlfiAlwzuJv5EVN8pVwYg7y18sgK8OGfijEejEFHgrFSd0FNuOSgITTHLTT1rusHw0oXe/E7mDKr4ZTu/i2G4xoHT6IY/q/zQtrxmmtWbHDlHTZSOWhl9yXrqo6dfxDkkzE8Tc9GMMUmzfjYGYbK8Wm4ZPK9J5qq7AE+JLCZk3RUIG2jJWiDI9H3e7ueSDWsD2eaT7iUQtUzklC478WK/IbRuuZo9B0zijwWM7PezI39tgYi67V/E4VryaLTZJpje8TlE++uPaogFmTCRHDAFfmILRuazRRXRakSQ1w=----ATTACHMENT:----NTg1NjAwNzkxNTY3NzM4NCA2MTc0NTM2NDMwODMzNjEwIDU2NDYxMTI5NTk1MzkyMzk=