Skip to content

Commit

Permalink
Merge pull request #9 from php-http/patch-common1.9
Browse files Browse the repository at this point in the history
Support both client-common ^1.9 and 2.x
  • Loading branch information
Nyholm authored Dec 29, 2018
2 parents 6a96192 + 31db633 commit 7736e42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@ matrix:
include:
- php: 5.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"

before_install:
- travis_retry composer self-update
- php: 7.1
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"

install:
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction

script:
- $TEST_COMMAND
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
}
],
"require": {
"php": ">=5.4",
"php": "^5.4 || ^7.0",
"psr/log": "^1.0",
"php-http/client-common": "^1.1",
"php-http/client-common": "^1.9 || ^2.0",
"php-http/message": "^1.0"
},
"require-dev": {
Expand All @@ -31,7 +31,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "1.1-dev"
}
},
"prefer-stable": true,
Expand Down
7 changes: 3 additions & 4 deletions src/LoggerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
final class LoggerPlugin implements Plugin
{
use VersionBridgePlugin;

private $logger;

private $formatter;
Expand All @@ -27,10 +29,7 @@ public function __construct(LoggerInterface $logger, Formatter $formatter = null
$this->formatter = $formatter ?: new SimpleFormatter();
}

/**
* {@inheritdoc}
*/
public function handleRequest(RequestInterface $request, callable $next, callable $first)
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)
{
$start = microtime(true);
$this->logger->info(sprintf("Sending request:\n%s", $this->formatter->formatRequest($request)), ['request' => $request]);
Expand Down

0 comments on commit 7736e42

Please sign in to comment.