@@ -107,8 +107,6 @@ class Psr6Store implements Psr6StoreInterface
107107 *
108108 * Type: string
109109 * Default: Cache-Tags
110- *
111- * @param array $options
112110 */
113111 public function __construct (array $ options = [])
114112 {
@@ -256,12 +254,10 @@ public function write(Request $request, Response $response)
256254 // Tags
257255 $ tags = [];
258256 if ($ response ->headers ->has ($ this ->options ['cache_tags_header ' ])) {
259- // Symfony < 4.4
260- $ headers = $ response ->headers ->get ($ this ->options ['cache_tags_header ' ], '' , false );
261- if (\is_string ($ headers )) {
262- // Symfony >= 4.4
263- $ headers = $ response ->headers ->all ($ this ->options ['cache_tags_header ' ]);
264- }
257+ // Compatibility with Symfony 3+
258+ $ allHeaders = $ response ->headers ->all ();
259+ $ key = str_replace ('_ ' , '- ' , strtolower ($ this ->options ['cache_tags_header ' ]));
260+ $ headers = isset ($ allHeaders [$ key ]) ? $ allHeaders [$ key ] : [];
265261
266262 foreach ($ headers as $ header ) {
267263 foreach (explode (', ' , $ header ) as $ tag ) {
@@ -428,8 +424,6 @@ public function prune()
428424 }
429425
430426 /**
431- * @param Request $request
432- *
433427 * @return string
434428 */
435429 public function getCacheKey (Request $ request )
@@ -442,9 +436,6 @@ public function getCacheKey(Request $request)
442436 }
443437
444438 /**
445- * @param array $vary
446- * @param Request $request
447- *
448439 * @return string
449440 */
450441 public function getVaryKey (array $ vary , Request $ request )
@@ -478,8 +469,6 @@ public function getVaryKey(array $vary, Request $request)
478469 }
479470
480471 /**
481- * @param Response $response
482- *
483472 * @return string
484473 */
485474 public function generateContentDigest (Response $ response )
0 commit comments