Skip to content

Commit

Permalink
Drop PHP <8.1 (EOL) (#190)
Browse files Browse the repository at this point in the history
* Drop PHP <8.1 (EOL)

* Fix GreedyCacheStrategy with negative TTL

* Disable fail-fast when testing

* Fix sprintf format
  • Loading branch information
Kevinrob authored Sep 12, 2024
1 parent 0dac345 commit 7508088
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
php-versions: ['8.1', '8.2', '8.3']
dependencies:
- "lowest"
- "highest"
fail-fast: false
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
],
"require": {
"php": ">=7.2.0",
"php": ">=8.1",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"guzzlehttp/promises": "^1.4 || ^2.0",
"guzzlehttp/psr7": "^1.7.0 || ^2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Strategy/GreedyCacheStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected function getCacheObject(RequestInterface $request, ResponseInterface $
$ttl = (int)reset($ttlHeaderValues);
}

return new CacheEntry($request->withoutHeader(static::HEADER_TTL), $response, new \DateTime(sprintf('+%d seconds', $ttl)));
return new CacheEntry($request->withoutHeader(static::HEADER_TTL), $response, new \DateTime(sprintf('%+d seconds', $ttl)));
}

public function fetch(RequestInterface $request)
Expand Down

0 comments on commit 7508088

Please sign in to comment.