Skip to content

Commit f18e470

Browse files
authored
Support both client-common ^1.9 and 2.x (#11)
* Support both client-common ^1.9 and 2.x * Typo * minors * Use Traits * cs * Make sure we test with both 2.0 and 1.9 of client-common * No need to have special test for client-common:1.9 That is already tested in prefer-lowest
1 parent 8314342 commit f18e470

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ matrix:
3030
- php: 7.1
3131
- php: 7.2
3232
env: COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage:^1.0"
33+
- php: 7.3
3334

3435
# Force some major versions of Symfony
3536
- php: 7.2

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=5.4",
15-
"symfony/stopwatch": "^2.7|^3.0|^4.0",
16-
"php-http/client-common": "^1.1"
14+
"php": "^5.4 || ^7.0",
15+
"symfony/stopwatch": "^2.7 || ^3.0 || ^4.0",
16+
"php-http/client-common": "^1.9 || ^2.0"
1717
},
1818
"require-dev": {
1919
"phpspec/phpspec": "^2.5 || ^3.0 || ^4.0"
@@ -29,7 +29,7 @@
2929
},
3030
"extra": {
3131
"branch-alias": {
32-
"dev-master": "1.0-dev"
32+
"dev-master": "1.2-dev"
3333
}
3434
},
3535
"prefer-stable": true,

src/StopwatchPlugin.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ final class StopwatchPlugin implements Plugin
1717
{
1818
const CATEGORY = 'php_http.request';
1919

20+
use VersionBridgePlugin;
21+
2022
/**
2123
* @var Stopwatch
2224
*/
@@ -30,10 +32,7 @@ public function __construct(Stopwatch $stopwatch)
3032
$this->stopwatch = $stopwatch;
3133
}
3234

33-
/**
34-
* {@inheritdoc}
35-
*/
36-
public function handleRequest(RequestInterface $request, callable $next, callable $first)
35+
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)
3736
{
3837
$eventName = $this->getStopwatchEventName($request);
3938
$this->stopwatch->start($eventName, self::CATEGORY);

0 commit comments

Comments
 (0)