diff --git a/CHANGELOG.md b/CHANGELOG.md index 4711924c6e6ae6c63fa80301d5437f5cfac8635e..25f34f45c11ca7021defc880ddbf053ad6d084ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ # Change Log +## 1.1.0 - 2023-04-14 + +### Changed + +- Allow `psr/http-message` v2 in addition to v1 +- Deprecate all interfaces in favor of [PSR-17](https://www.php-fig.org/psr/psr-17/) + ## 1.0.2 - 2015-12-19 ### Added diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 0000000000000000000000000000000000000000..841914ae13eaa49991acc65a790e823eff0e2abb --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1 @@ +Please see http://docs.php-http.org/en/latest/development/contributing.html diff --git a/LICENSE b/LICENSE index 8e2c4a0b85c31bf132105920cc90ba371025eb8a..4558d6f06306fce15add8bc10e29152bc4ad5355 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015 PHP HTTP Team <team@php-http.org> +Copyright (c) 2015-2016 PHP HTTP Team <team@php-http.org> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4654495a72f8c46a8d75eea963dc8ff1517993a1..6c3b74500978f8fc155209cc35e228ccd2f628a1 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,12 @@ **Factory interfaces for PSR-7 HTTP Message.** +## Obsolete + +The PHP-HTTP factories have become obsolete with the [PSR-17](https://www.php-fig.org/psr/psr-17/) factories standard. +All major HTTP client implementors provide [PSR-17 factories](https://packagist.org/packages/psr/http-factory). + +This package will remain available for the time being to not break legacy code, but we encourage everybody to move to PSR-17. ## Install @@ -18,12 +24,12 @@ $ composer require php-http/message-factory ## Documentation -Please see the [official documentation](http://php-http.readthedocs.org/en/latest/message-factory/). +Please see the [official documentation](http://docs.php-http.org/en/latest/message/message-factory.html). ## Contributing -Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). ## Security diff --git a/composer.json b/composer.json index 7c72febe5b40c1abd64b6ed844cecf544e975bca..57bdb4b9be2c78c32561bba791bffa27f26a145f 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "php": ">=5.4", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "autoload": { "psr-4": { @@ -21,7 +21,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.x-dev" } } } diff --git a/puli.json b/puli.json index 08d37627d1d9f60a6f11c6f7051975393710f5b0..fac317b0b5e65ff48a777d572f07a578d17326d7 100644 --- a/puli.json +++ b/puli.json @@ -1,5 +1,6 @@ { "version": "1.0", + "name": "php-http/message-factory", "binding-types": { "Http\\Message\\MessageFactory": { "description": "PSR-7 Message Factory", diff --git a/src/MessageFactory.php b/src/MessageFactory.php index 965aaa804e58cc65f145e58a021ec4d61094672d..2ed7e45387edf5ec12c06c510634dc17bb5507a2 100644 --- a/src/MessageFactory.php +++ b/src/MessageFactory.php @@ -6,6 +6,8 @@ namespace Http\Message; * Factory for PSR-7 Request and Response. * * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> + * + * @deprecated since version 1.1, use Psr\Http\Message\RequestFactoryInterface and Psr\Http\Message\ResponseFactoryInterface instead. */ interface MessageFactory extends RequestFactory, ResponseFactory { diff --git a/src/RequestFactory.php b/src/RequestFactory.php index 624e82f361c0691f2112e866f39bffcde71d122f..09879f15fa3bebb974d53bdfe49f8c326f436ab9 100644 --- a/src/RequestFactory.php +++ b/src/RequestFactory.php @@ -10,6 +10,8 @@ use Psr\Http\Message\StreamInterface; * Factory for PSR-7 Request. * * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> + * + * @deprecated since version 1.1, use Psr\Http\Message\RequestFactoryInterface instead. */ interface RequestFactory { diff --git a/src/ResponseFactory.php b/src/ResponseFactory.php index 2411ed3a179ee3e0fe2b99cb2a9c83ac6548fc0f..eb9bde775aa5bff3c8d4c46af44a189fe530ffdb 100644 --- a/src/ResponseFactory.php +++ b/src/ResponseFactory.php @@ -11,6 +11,8 @@ use Psr\Http\Message\StreamInterface; * This factory contract can be reused in Message and Server Message factories. * * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> + * + * @deprecated since version 1.1, use Psr\Http\Message\ResponseFactoryInterface instead. */ interface ResponseFactory { diff --git a/src/StreamFactory.php b/src/StreamFactory.php index 327a902f9547cb7dd332e8a81b682c6ed9ac3a8a..bd949a4ab92b0ba23bcaa179eb67bdbcc08890a1 100644 --- a/src/StreamFactory.php +++ b/src/StreamFactory.php @@ -8,6 +8,8 @@ use Psr\Http\Message\StreamInterface; * Factory for PSR-7 Stream. * * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> + * + * @deprecated since version 1.1, use Psr\Http\Message\StreamFactoryInterface instead. */ interface StreamFactory { @@ -18,8 +20,8 @@ interface StreamFactory * * @return StreamInterface * - * @throws \InvalidArgumentException If the stream body is invalid. - * @throws \RuntimeException If creating the stream from $body fails. + * @throws \InvalidArgumentException if the stream body is invalid + * @throws \RuntimeException if creating the stream from $body fails */ public function createStream($body = null); } diff --git a/src/UriFactory.php b/src/UriFactory.php index f05e62521087e1179fe758d772a438a539829dc5..96416b7427d3fc4eacd5efa0fc316c81c97d81fd 100644 --- a/src/UriFactory.php +++ b/src/UriFactory.php @@ -8,6 +8,8 @@ use Psr\Http\Message\UriInterface; * Factory for PSR-7 URI. * * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> + * + * @deprecated since version 1.1, use Psr\Http\Message\UriFactoryInterface instead. */ interface UriFactory { @@ -18,7 +20,7 @@ interface UriFactory * * @return UriInterface * - * @throws \InvalidArgumentException If the $uri argument can not be converted into a valid URI. + * @throws \InvalidArgumentException if the $uri argument can not be converted into a valid URI */ public function createUri($uri); }