Skip to content

Commit

Permalink
Fix deprecated notice in PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
danieliser committed Aug 25, 2024
1 parent 6d9a85b commit 5bb1c95
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion classes/Model/Popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,19 @@ public function get_last_count_reset() {
* @return bool
*/
public function compare_resets( $a, $b ) {
return (float) $a['timestamp'] < (float) $b['timestamp'];
$a = (float) $a['timestamp'];
$b = (float) $b['timestamp'];

// TODO Replace this with PHP 7.4 `<=>` operator once we drop support for PHP 5.6.
// return (float) $a['timestamp'] <=> (float) $b['timestamp'];

if ( $a < $b ) {
return -1;
} elseif ( $a > $b ) {
return 1;
} else {
return 0;
}
}

/**
Expand Down

0 comments on commit 5bb1c95

Please sign in to comment.