From 0f661249e3b5f103c085ca706afbe359a75b0111 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 6 Jul 2020 19:06:32 +0100 Subject: [PATCH 1/3] More specific plugin type doc --- src/Plugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index cbc9592..99898b9 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -24,8 +24,8 @@ interface Plugin * * @see http://docs.php-http.org/en/latest/plugins/build-your-own.html * - * @param callable $next Next middleware in the chain, the request is passed as the first argument - * @param callable $first First middleware in the chain, used to to restart a request + * @param callable(RequestInterface): Promise $next Next middleware in the chain, the request is passed as the first argument + * @param callable(RequestInterface): Promise $first First middleware in the chain, used to to restart a request * * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient) */ From d94c9324bc7d39f87c90486c27d728108343aef6 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 6 Jul 2020 21:39:10 +0100 Subject: [PATCH 2/3] Fixed typo --- src/Plugin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index 99898b9..7c6cd58 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -6,6 +6,7 @@ use Http\Promise\Promise; use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; /** * A plugin is a middleware to transform the request and/or the response. @@ -24,8 +25,8 @@ interface Plugin * * @see http://docs.php-http.org/en/latest/plugins/build-your-own.html * - * @param callable(RequestInterface): Promise $next Next middleware in the chain, the request is passed as the first argument - * @param callable(RequestInterface): Promise $first First middleware in the chain, used to to restart a request + * @param callable(ResponseInterface): Promise $next Next middleware in the chain, the request is passed as the first argument + * @param callable(ResponseInterface): Promise $first First middleware in the chain, used to to restart a request * * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient) */ From c751c7319d36b02a762d16f6fb319115d41d80d1 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 6 Jul 2020 22:05:43 +0100 Subject: [PATCH 3/3] Wasn't a typo... it's getting late :laugh: --- src/Plugin.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index 7c6cd58..99898b9 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -6,7 +6,6 @@ use Http\Promise\Promise; use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\ResponseInterface; /** * A plugin is a middleware to transform the request and/or the response. @@ -25,8 +24,8 @@ interface Plugin * * @see http://docs.php-http.org/en/latest/plugins/build-your-own.html * - * @param callable(ResponseInterface): Promise $next Next middleware in the chain, the request is passed as the first argument - * @param callable(ResponseInterface): Promise $first First middleware in the chain, used to to restart a request + * @param callable(RequestInterface): Promise $next Next middleware in the chain, the request is passed as the first argument + * @param callable(RequestInterface): Promise $first First middleware in the chain, used to to restart a request * * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient) */