Skip to content

removed array_multisort #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 0 additions & 74 deletions generated/array.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,80 +58,6 @@ function array_flip(array $array): array
}


/**
* array_multisort can be used to sort several
* arrays at once, or a multi-dimensional array by one or more
* dimensions.
*
* Associative (string) keys will be maintained, but numeric
* keys will be re-indexed.
*
* @param array $array1 An array being sorted.
* @param array|int $array1_sort_order The order used to sort the previous array argument. Either
* SORT_ASC to sort ascendingly or SORT_DESC
* to sort descendingly.
*
* This argument can be swapped with array1_sort_flags
* or omitted entirely, in which case SORT_ASC is assumed.
* @param array|int $array1_sort_flags Sort options for the previous array argument:
*
* Sorting type flags:
*
*
* SORT_REGULAR - compare items normally
* (don't change types)
*
*
* SORT_NUMERIC - compare items numerically
*
*
* SORT_STRING - compare items as strings
*
*
*
* SORT_LOCALE_STRING - compare items as
* strings, based on the current locale. It uses the locale,
* which can be changed using setlocale
*
*
*
*
* SORT_NATURAL - compare items as strings
* using "natural ordering" like natsort
*
*
*
*
* SORT_FLAG_CASE - can be combined
* (bitwise OR) with
* SORT_STRING or
* SORT_NATURAL to sort strings case-insensitively
*
*
*
*
* This argument can be swapped with array1_sort_order
* or omitted entirely, in which case SORT_REGULAR is assumed.
* @param mixed $params More arrays, optionally followed by sort order and flags. Only elements
* corresponding to equivalent elements in previous arrays are compared.
* In other words, the sort is lexicographical.
* @throws ArrayException
*
*/
function array_multisort(array &$array1, $array1_sort_order = SORT_ASC, $array1_sort_flags = SORT_REGULAR, ...$params): void
{
error_clear_last();
if ($params !== []) {
$result = \array_multisort($array1, $array1_sort_order, $array1_sort_flags, ...$params);
} else {
$result = \array_multisort($array1, $array1_sort_order, $array1_sort_flags);
}
if ($result === false) {
throw ArrayException::createFromPhpError();
}
}


/**
* array_replace_recursive replaces the values of
* array1 with the same values from all the following
Expand Down
1 change: 0 additions & 1 deletion generated/functionsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
'apcu_sma_info',
'array_combine',
'array_flip',
'array_multisort',
'array_replace_recursive',
'array_replace',
'array_walk_recursive',
Expand Down
1 change: 1 addition & 0 deletions generator/config/ignoredFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
'readdir', //the documentation is false: the function return false at the end of the iteration
'apcu_delete', //apcu_delete returns false when the $key does not exist in the cache store
'filter_has_var', //this function is meant to return true or false
'array_multisort', // this function si too buggy, see PR #113 on github
];
1 change: 0 additions & 1 deletion rector-migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ services:
apcu_sma_info: 'Safe\apcu_sma_info'
array_combine: 'Safe\array_combine'
array_flip: 'Safe\array_flip'
array_multisort: 'Safe\array_multisort'
array_replace_recursive: 'Safe\array_replace_recursive'
array_replace: 'Safe\array_replace'
array_walk_recursive: 'Safe\array_walk_recursive'
Expand Down