123456789101112131415161718192021222324252627282930 |
- <?php
- /**
- * @file
- * NativeSort.php
- *
- * @author: marand
- *
- * @license General Public License version 2 or later
- */
- namespace OSInet\Sort;
- /**
- * Class NativeSort: use PHP builtin usort() function.
- *
- * @package OSInet\Sort
- *
- * @see http://en.wikipedia.org/wiki/Insertion_sort
- */
- class NativeSort extends Sort {
- /**
- * {@inheritdoc}
- */
- public function sort($data, $comparison, $options = array()) {
- $sorted = $data;
- usort($sorted, $comparison);
- return $sorted;
- }
- }
|