Skip to content

Commit

Permalink
Add support for PHP 8.0 (#59)
Browse files Browse the repository at this point in the history
* Support PHP 8.0

* Fix PHP 8 deprecation

* Apply spaceship operator suggestion from @jdreesen

Co-authored-by: Jacob Dreesen <[email protected]>

* Apply version constraint fix from @Korbeil

Co-authored-by: Baptiste Leduc <[email protected]>

Co-authored-by: Jacob Dreesen <[email protected]>
Co-authored-by: Baptiste Leduc <[email protected]>
  • Loading branch information
3 people authored Feb 16, 2021
1 parent 150abf3 commit 3cd0685
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ cache:
matrix:
fast_finish: true
include:
- php: 8.0
env: TARGET=test
- php: 7.4
env: TARGET=test
- php: 7.2
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.2 || ^8.0",
"ext-json": "*",
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
"ruflin/elastica": "^7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/IndexBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function purgeOldIndices(string $indexName): array

// Newest first
uasort($indexes, function ($a, $b) {
return $a['date'] < $b['date'];
return $b['date'] <=> $a['date'];
});

$afterLiveCounter = 0;
Expand Down

0 comments on commit 3cd0685

Please sign in to comment.