Skip to content

Commit 561b544

Browse files
authored
Support both client-common ^1.9 and 2.x (#52)
* Support both client-common ^1.9 and 2.x * Use Traits * Make sure we test with both 2.0 and 1.9 of client-common * Drop tests on hhvm * No need to have special test for client-common:1.9 That is already tested in prefer-lowest * Run test on php7.1
1 parent 5ae8a80 commit 561b544

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ php:
1212
- 5.6
1313
- 7.0
1414
- 7.1
15+
- 7.2
16+
- 7.3
1517

1618
env:
1719
global:
@@ -26,16 +28,16 @@ matrix:
2628
include:
2729
- php: 5.4
2830
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
29-
- php: hhvm
30-
dist: trusty
31+
- php: 7.1
32+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
3133

3234
before_install:
3335
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
3436

3537
install:
3638
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
3739
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
38-
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
40+
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
3941

4042
script:
4143
- $TEST_COMMAND

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"require": {
1414
"php": "^5.4 || ^7.0",
1515
"psr/cache": "^1.0",
16-
"php-http/client-common": "^1.1",
16+
"php-http/client-common": "^1.9 || ^2.0",
1717
"php-http/message-factory": "^1.0",
1818
"symfony/options-resolver": "^2.6 || ^3.0 || ^4.0"
1919
},
@@ -39,5 +39,7 @@
3939
"branch-alias": {
4040
"dev-master": "1.6-dev"
4141
}
42-
}
42+
},
43+
"prefer-stable": true,
44+
"minimum-stability": "dev"
4345
}

src/CachePlugin.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
final class CachePlugin implements Plugin
2525
{
26+
use VersionBridgePlugin;
27+
2628
/**
2729
* @var CacheItemPoolInterface
2830
*/
@@ -124,10 +126,7 @@ public static function serverCache(CacheItemPoolInterface $pool, StreamFactory $
124126
return new self($pool, $streamFactory, $config);
125127
}
126128

127-
/**
128-
* {@inheritdoc}
129-
*/
130-
public function handleRequest(RequestInterface $request, callable $next, callable $first)
129+
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)
131130
{
132131
$method = strtoupper($request->getMethod());
133132
// if the request not is cachable, move to $next

0 commit comments

Comments
 (0)