Fix PHP 8.2 error on sorting values

This commit is contained in:
Benjamin Renard 2024-02-10 18:35:41 +01:00
parent bf1a3affe4
commit dc8e08b5d1
3 changed files with 9 additions and 9 deletions

View file

@ -187,11 +187,11 @@ class LSattr_html_select_list extends LSattr_html{
* Function use with uasort to sort two values in ASC order
*
* @param string $va One value
* @param string $va One value
* @param string $vb Another value
*
* @return int Value for uasort
**/
protected static function _sortTwoValuesAsc(&$va,&$vb) {
protected static function _sortTwoValuesAsc($va,$vb) {
if (is_array($va)) {
// Force sub-options at the end
$nva='ZZZZ'.$va['label'];
@ -217,11 +217,11 @@ class LSattr_html_select_list extends LSattr_html{
* Function use with uasort to sort two values in DESC order
*
* @param string $va One value
* @param string $va One value
* @param string $vb Another value
*
* @return int Value for uasort
**/
protected static function _sortTwoValuesDesc(&$va,&$vb) {
protected static function _sortTwoValuesDesc($va,$vb) {
return (-1 * static :: _sortTwoValuesAsc($va,$vb));
}

View file

@ -149,11 +149,11 @@ class LSformElement_select_object extends LSformElement {
* Function use with uasort to sort two values
*
* @param array $va One value
* @param array $va One value
* @param array $va Another value
*
* @return int Value for uasort
**/
private function _sortTwoValues(&$va,&$vb) {
private function _sortTwoValues($va, $vb) {
if ($this -> getParam('html_options.sortDirection') == 'DESC') {
$dir=-1;
}

View file

@ -1392,12 +1392,12 @@ class LSsearch extends LSlog_staticLoggerClass {
/**
* Function use with uasort to sort two entry
*
* @param LSsearchEntry &$a One entry of result
* @param LSsearchEntry &$b One entry of result
* @param LSsearchEntry $a One entry of result
* @param LSsearchEntry $b Another entry of result
*
* @return int Value for uasort
**/
private function _sortTwoEntry(&$a,&$b) {
private function _sortTwoEntry($a, $b) {
$sortBy = $this -> params['sortBy'];
$sortDirection = $this -> params['sortDirection'];
if ($sortDirection=='ASC') {