Skip to content

Commit

Permalink
Merge pull request #126 from devgeniem/php81-usort-fix
Browse files Browse the repository at this point in the history
Usort fixes
  • Loading branch information
tim0haapala committed Jan 20, 2023
2 parents deb4e8e + 2d7aaec commit b133e84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Search/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ public function create_taxonomy_query( array $query, string $operator = 'AND', b

// All minuses to the end of the line.
usort( $queries, function( $a, $b ) {
return ( substr( $a, 0, 1 ) === '-' );
return ( substr( $a, 0, 1 ) === '-' ) ? 1 : 0;
});

// Compare the relation.
Expand Down Expand Up @@ -807,7 +807,7 @@ protected function create_meta_query( array $query, string $operator = 'AND' ) :

// All minuses to the end of the line.
usort( $queries, function( $a, $b ) {
return ( substr( $a, 0, 1 ) === '-' );
return ( substr( $a, 0, 1 ) === '-' ) ? 1 : 0;
});

$queries = array_filter( $queries, function( $query ) {
Expand Down Expand Up @@ -868,7 +868,7 @@ protected function create_meta_query( array $query, string $operator = 'AND' ) :

// All minuses to the end of the line.
usort( $queries, function( $a, $b ) {
return ( substr( $a, 0, 1 ) === '-' );
return ( substr( $a, 0, 1 ) === '-' ) ? 1 : 0;
});

$queries = array_filter( $queries, function( $query ) {
Expand Down

0 comments on commit b133e84

Please sign in to comment.