Skip to content

Commit f2658d9

Browse files
committed
Merge branch 'hotfix/2.1.2'
2 parents 7538b8b + 8970228 commit f2658d9

File tree

4 files changed

+11
-32
lines changed

4 files changed

+11
-32
lines changed

.travis.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,13 @@ matrix:
1212
- php: 7.2
1313
- php: 7.2
1414
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
15-
- php: 7.3
16-
env: COVERAGE='--coverage-clover build/logs/clover.xml'
1715
- php: 7.3
1816
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
19-
- php: 7.4snapshot
20-
- php: 7.4snapshot
21-
env: COMPOSER_DEV_STABILITY=true
22-
- php: 7.4snapshot
17+
- php: 7.4
18+
- php: 7.4
2319
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
24-
- php: nightly
25-
- php: nightly
26-
env: COMPOSER_DEV_STABILITY=true
27-
- php: nightly
28-
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
29-
allow_failures:
30-
- php: 7.4snapshot
31-
- php: nightly
20+
- php: 7.4
21+
env: COVERAGE='--coverage-clover build/logs/clover.xml'
3222

3323
before_script:
3424
- |

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^5.6|^7.0",
13+
"php": "^5.6|^7.1",
1414
"symfony/lock": "^3.4|^4.0|^5.0",
1515
"symfony/cache": "^3.4|^4.0|^5.0",
1616
"symfony/http-foundation": "^3.0|^4.0|^5.0",
1717
"symfony/http-kernel": "^3.0|^4.0|^5.0",
1818
"symfony/options-resolver": "^3.0|^4.0|^5.0"
1919
},
2020
"require-dev": {
21-
"friendsofphp/php-cs-fixer": "^2.12",
21+
"friendsofphp/php-cs-fixer": "^2.16.1",
2222
"symfony/phpunit-bridge": "^4.3.5",
2323
"php-coveralls/php-coveralls": "^2.1"
2424
},

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
bootstrap="vendor/autoload.php"
1212
>
1313
<php>
14-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
14+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0" />
1515
</php>
1616
<testsuites>
1717
<testsuite name="PSR-6 HttpCache Store Test Suite">

src/Psr6Store.php

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)