Download the PHP package rmtram/sorter without Composer
On this page you can find all versions of the php package rmtram/sorter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rmtram/sorter
More information about rmtram/sorter
Files in rmtram/sorter
Package sorter
Short Description Simple sort of multiple arrays.
License MIT
Homepage https://github.com/Rmtram/Sorter
Informations about the package sorter
Sorter
Simple sort of multiple arrays.
Install
OR
Copy file: src/Sorter.php
Contents
- [static] make(array $items)
- [static] runSort(array $items, array $orders, $select = [], $offset = null, $limit = null)
- sort(array $orders)
- select(array $attributes)
- offset(int|null $int = null)
- limit(int|null $int = null)
Methods
make
- Create instance.
runSort
- Result
sort
Single (id => asc)
-
Source code
- Result
Multiple
-
Source code
- Result
select
Single
-
Source code
- Result
Multiple
-
Source code
- Result
offset
Offset null === offset 0
!!! Important !!!
Changed offset implementation.
Before
After
-
Source code
- Result
limit
No limit in the case of null
-
Source code
- Result
Support versions.
- PHP
- 7.2
- 7.3
- 7.4
LICENSE
The MIT License (MIT)
Copyright (c) 2016 Rmtram
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.