Skip to content

Support common client 2.x #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 29, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Collector/ProfileClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Http\HttplugBundle\Collector;

use Http\Client\Common\FlexibleHttpClient;
use Http\Client\Common\VersionBridgeClient;
use Http\Client\Exception\HttpException;
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
Expand All @@ -21,6 +22,8 @@
*/
class ProfileClient implements HttpClient, HttpAsyncClient
{
use VersionBridgeClient;

/**
* @var HttpClient|HttpAsyncClient
*/
Expand Down Expand Up @@ -114,10 +117,7 @@ public function sendAsyncRequest(RequestInterface $request)
}
}

/**
* {@inheritdoc}
*/
public function sendRequest(RequestInterface $request)
protected function doSendRequest(RequestInterface $request)
{
$stack = $this->collector->getActiveStack();
if (null === $stack) {
Expand Down
7 changes: 3 additions & 4 deletions Collector/ProfilePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
class ProfilePlugin implements Plugin
{
use Plugin\VersionBridgePlugin;

/**
* @var Plugin
*/
Expand Down Expand Up @@ -44,10 +46,7 @@ public function __construct(Plugin $plugin, Collector $collector, Formatter $for
$this->formatter = $formatter;
}

/**
* {@inheritdoc}
*/
public function handleRequest(RequestInterface $request, callable $next, callable $first)
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)
{
$profile = new Profile(get_class($this->plugin));

Expand Down
7 changes: 3 additions & 4 deletions Collector/StackPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
class StackPlugin implements Plugin
{
use Plugin\VersionBridgePlugin;

/**
* @var Collector
*/
Expand Down Expand Up @@ -44,10 +46,7 @@ public function __construct(Collector $collector, Formatter $formatter, $client)
$this->client = $client;
}

/**
* {@inheritdoc}
*/
public function handleRequest(RequestInterface $request, callable $next, callable $first)
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)
{
$stack = new Stack($this->client, $this->formatter->formatRequest($request));

Expand Down
7 changes: 2 additions & 5 deletions Tests/Functional/ProfilingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,9 @@ private function createClient(array $plugins, $clientName = 'Acme', array $clien
}
}

class ExceptionThrowerPlugin implements Plugin
class ExceptionThrowerPlugin extends Plugin\VersionBridgePlugin
{
/**
* {@inheritdoc}
*/
public function handleRequest(RequestInterface $request, callable $next, callable $first)
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)
{
throw new \Exception();
}
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
],
"require": {
"php": "^5.5 || ^7.0",
"php-http/client-common": "^1.6 || ^2.0",
"php-http/client-common": "^1.9 || ^2.0",
"php-http/client-implementation": "^1.0",
"php-http/cache-plugin": "^1.4",
"php-http/cache-plugin": "^1.6",
"php-http/discovery": "^1.0",
"php-http/httplug": "^1.0 || ^2.0",
"php-http/logger-plugin": "^1.0",
"php-http/logger-plugin": "^1.1",
"php-http/message": "^1.4",
"php-http/message-factory": "^1.0.2",
"php-http/stopwatch-plugin": "^1.0",
"php-http/stopwatch-plugin": "^1.2",
"psr/http-message": "^1.0",
"symfony/config": "^2.8 || ^3.0 || ^4.0",
"symfony/dependency-injection": "^2.8.3 || ^3.0.3 || ^4.0",
Expand Down