Skip to content

Commit 81264f2

Browse files
committed
Deprecate plugins and plugin client
1 parent 9395b4f commit 81264f2

26 files changed

+61
-15
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change Log
22

3+
4+
## Unreleased
5+
6+
### Deprecated
7+
8+
- Core plugins and plugin client, moved to [client-common](https://github.com/php-http/client-common)
9+
- Logger plugin, moved to [logger-plugin](https://github.com/php-http/logger-plugin)
10+
- Cache plugin, moved to [cache-plugin](https://github.com/php-http/cache-plugin)
11+
- Stopwatch plugin, moved to [stopwatch-plugin](https://github.com/php-http/stopwatch-plugin)
12+
13+
314
## 1.0.1 - 2016-01-29
415

516
### Changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"php": ">=5.4",
1515
"php-http/httplug": "^1.0",
1616
"php-http/message-factory": "^1.0.2",
17-
"php-http/client-common": "^1.0",
17+
"php-http/client-common": "^1.1",
1818
"php-http/message": "^1.0",
1919
"symfony/options-resolver": "^2.6|^3.0"
2020
},

src/AddHostPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Add schema and host to a request. Can be set to overwrite the schema and host if desired.
1111
*
1212
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
13+
*
14+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\AddHostPlugin} instead.
1315
*/
1416
class AddHostPlugin implements Plugin
1517
{

src/AuthenticationPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* Send an authenticated request.
1010
*
1111
* @author Joel Wurtz <joel.wurtz@gmail.com>
12+
*
13+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\AuthenticationPlugin} instead.
1214
*/
1315
class AuthenticationPlugin implements Plugin
1416
{

src/CachePlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Allow for caching a response.
1414
*
1515
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
16+
*
17+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\CachePlugin} instead.
1618
*/
1719
class CachePlugin implements Plugin
1820
{

src/ContentLengthPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* Allow to set the correct content length header on the request or to transfer it as a chunk if not possible.
1010
*
1111
* @author Joel Wurtz <joel.wurtz@gmail.com>
12+
*
13+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\ContentLengthPlugin} instead.
1214
*/
1315
class ContentLengthPlugin implements Plugin
1416
{

src/CookiePlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
* Handle request cookies.
1313
*
1414
* @author Joel Wurtz <joel.wurtz@gmail.com>
15+
*
16+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\CookiePlugin} instead.
1517
*/
1618
class CookiePlugin implements Plugin
1719
{

src/DecoderPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* If Content-Encoding is not disabled, the plugin will add an Accept-Encoding header for the encoding methods it supports.
2020
*
2121
* @author Joel Wurtz <joel.wurtz@gmail.com>
22+
*
23+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\DecoderPlugin} instead.
2224
*/
2325
class DecoderPlugin implements Plugin
2426
{

src/ErrorPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* By default an exception will be thrown for all status codes from 400 to 599.
1414
*
1515
* @author Joel Wurtz <joel.wurtz@gmail.com>
16+
*
17+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\ErrorPlugin} instead.
1618
*/
1719
class ErrorPlugin implements Plugin
1820
{

src/Exception/CircularRedirectionException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Thrown when circular redirection is detected.
99
*
1010
* @author Joel Wurtz <joel.wurtz@gmail.com>
11+
*
12+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\CircularRedirectionException} instead.
1113
*/
1214
class CircularRedirectionException extends HttpException
1315
{

src/Exception/ClientErrorException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Thrown when there is a client error (4xx).
99
*
1010
* @author Joel Wurtz <joel.wurtz@gmail.com>
11+
*
12+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\ClientErrorException} instead.
1113
*/
1214
class ClientErrorException extends HttpException
1315
{

src/Exception/LoopException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/**
88
* @author Joel Wurtz <joel.wurtz@gmail.com>
9+
*
10+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\LoopException} instead.
911
*/
1012
class LoopException extends RequestException
1113
{

src/Exception/MultipleRedirectionException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Redirect location cannot be chosen.
99
*
1010
* @author Joel Wurtz <joel.wurtz@gmail.com>
11+
*
12+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\MultipleRedirectionException} instead.
1113
*/
1214
class MultipleRedirectionException extends HttpException
1315
{

src/Exception/ServerErrorException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Thrown when there is a server error (5xx).
99
*
1010
* @author Joel Wurtz <joel.wurtz@gmail.com>
11+
*
12+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Exception\ServerErrorException} instead.
1113
*/
1214
class ServerErrorException extends HttpException
1315
{

src/HeaderAppendPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* @link https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
1414
*
1515
* @author Soufiane Ghzal <sghzal@gmail.com>
16+
*
17+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HeaderAppendPlugin} instead.
1618
*/
1719
class HeaderAppendPlugin implements Plugin
1820
{

src/HeaderDefaultsPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* If a given header already exists the value wont be replaced and the request wont be changed.
1010
*
1111
* @author Soufiane Ghzal <sghzal@gmail.com>
12+
*
13+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HeaderDefaultsPlugin} instead.
1214
*/
1315
class HeaderDefaultsPlugin implements Plugin
1416
{

src/HeaderRemovePlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* Removes headers from the request.
99
*
1010
* @author Soufiane Ghzal <sghzal@gmail.com>
11+
*
12+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HeaderRemovePlugin} instead.
1113
*/
1214
class HeaderRemovePlugin implements Plugin
1315
{

src/HeaderSetPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* If the header does not exist it wil be set, if the header already exists it will be replaced.
1010
*
1111
* @author Soufiane Ghzal <sghzal@gmail.com>
12+
*
13+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HeaderSetPlugin} instead.
1214
*/
1315
class HeaderSetPlugin implements Plugin
1416
{

src/HistoryPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
/**
1010
* Record http call.
11+
*
12+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\HistoryPlugin} instead.
1113
*/
1214
class HistoryPlugin implements Plugin
1315
{

src/Journal.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Records history of http calls.
1111
*
1212
* @author Joel Wurtz <joel.wurtz@gmail.com>
13+
*
14+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\Journal} instead.
1315
*/
1416
interface Journal
1517
{

src/LoggerPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Log request, response and exception for a HTTP Client.
1414
*
1515
* @author Joel Wurtz <joel.wurtz@gmail.com>
16+
*
17+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\LoggerPlugin} instead.
1618
*/
1719
class LoggerPlugin implements Plugin
1820
{

src/Plugin.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
namespace Http\Client\Plugin;
44

5-
use Http\Promise\Promise;
6-
use Psr\Http\Message\RequestInterface;
7-
85
/**
96
* A plugin is a middleware to transform the request and/or the response.
107
*
@@ -14,17 +11,9 @@
1411
* - restart the request
1512
*
1613
* @author Joel Wurtz <joel.wurtz@gmail.com>
14+
*
15+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin} instead.
1716
*/
18-
interface Plugin
17+
interface Plugin extends \Http\Client\Common\Plugin
1918
{
20-
/**
21-
* Handle the request and return the response coming from the next callable.
22-
*
23-
* @param RequestInterface $request
24-
* @param callable $next Next middleware in the chain, the request is passed as the first argument
25-
* @param callable $first First middleware in the chain, used to to restart a request
26-
*
27-
* @return Promise
28-
*/
29-
public function handleRequest(RequestInterface $request, callable $next, callable $first);
3019
}

src/PluginClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* The client managing plugins and providing a decorator around HTTP Clients.
1717
*
1818
* @author Joel Wurtz <joel.wurtz@gmail.com>
19+
*
20+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\PluginClient} instead.
1921
*/
2022
final class PluginClient implements HttpClient, HttpAsyncClient
2123
{

src/RedirectPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Follow redirections.
1616
*
1717
* @author Joel Wurtz <joel.wurtz@gmail.com>
18+
*
19+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\RedirectPlugin} instead.
1820
*/
1921
class RedirectPlugin implements Plugin
2022
{

src/RetryPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* By default will retry only one time.
1414
*
1515
* @author Joel Wurtz <joel.wurtz@gmail.com>
16+
*
17+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\RetryPlugin} instead.
1618
*/
1719
class RetryPlugin implements Plugin
1820
{

src/StopwatchPlugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* Measure the duration of a request call with the stopwatch component.
1212
*
1313
* @author Joel Wurtz <joel.wurtz@gmail.com>
14+
*
15+
* @deprecated since since version 1.1, and will be removed in 2.0. Use {@link \Http\Client\Common\Plugin\StopwatchPlugin} instead.
1416
*/
1517
class StopwatchPlugin implements Plugin
1618
{

0 commit comments

Comments
 (0)