@@ -60,7 +60,7 @@ class Psr6Store implements Psr6StoreInterface, ClearableInterface
60
60
private string $ hashAlgorithm ;
61
61
62
62
/**
63
- * When creating a Psr6Store you can configure a number options.
63
+ * When creating a Psr6Store you can configure a number of options.
64
64
* See the README for a list of all available options and their description.
65
65
*/
66
66
public function __construct (array $ options = [])
@@ -100,7 +100,7 @@ public function __construct(array $options = [])
100
100
$ this ->options = $ resolver ->resolve ($ options );
101
101
$ this ->cache = $ this ->options ['cache ' ];
102
102
$ this ->lockFactory = $ this ->options ['lock_factory ' ];
103
- $ this ->hashAlgorithm = version_compare ( PHP_VERSION , ' 8.1.0 ' , ' >= ' ) ? 'xxh128 ' : 'sha256 ' ;
103
+ $ this ->hashAlgorithm = \ PHP_VERSION_ID >= 80100 ? 'xxh128 ' : 'sha256 ' ;
104
104
}
105
105
106
106
public function lookup (Request $ request ): ?Response
@@ -227,7 +227,7 @@ public function unlock(Request $request): bool
227
227
228
228
try {
229
229
$ this ->locks [$ cacheKey ]->release ();
230
- } catch (LockReleasingException $ e ) {
230
+ } catch (LockReleasingException ) {
231
231
return false ;
232
232
} finally {
233
233
unset($ this ->locks [$ cacheKey ]);
@@ -260,7 +260,7 @@ public function cleanup(): void
260
260
foreach ($ this ->locks as $ lock ) {
261
261
$ lock ->release ();
262
262
}
263
- } catch (LockReleasingException $ e ) {
263
+ } catch (LockReleasingException ) {
264
264
// noop
265
265
} finally {
266
266
$ this ->locks = [];
@@ -281,7 +281,7 @@ public function invalidateTags(array $tags): bool
281
281
282
282
try {
283
283
return $ this ->cache ->invalidateTags ($ tags );
284
- } catch (CacheInvalidArgumentException $ e ) {
284
+ } catch (CacheInvalidArgumentException ) {
285
285
return false ;
286
286
}
287
287
}
@@ -508,13 +508,13 @@ private function restoreResponse(array $cacheData): ?Response
508
508
509
509
// BC
510
510
if (\is_string ($ value )) {
511
- $ value = ['expires ' => 0 , ' contents ' => $ value ];
511
+ $ value = ['contents ' => $ value ];
512
512
}
513
513
514
514
if ($ this ->isBinaryFileResponseContentDigest ($ cacheData ['headers ' ]['x-content-digest ' ][0 ])) {
515
515
try {
516
516
$ file = new File ($ value ['contents ' ]);
517
- } catch (FileNotFoundException $ e ) {
517
+ } catch (FileNotFoundException ) {
518
518
return null ;
519
519
}
520
520
@@ -542,7 +542,7 @@ private function getDefaultLockStore(string $cacheDir): PersistingStoreInterface
542
542
{
543
543
try {
544
544
return new SemaphoreStore ();
545
- } catch (LockInvalidArgumentException $ exception ) {
545
+ } catch (LockInvalidArgumentException ) {
546
546
return new FlockStore ($ cacheDir );
547
547
}
548
548
}
0 commit comments