+ *
+ * @author Nicolas Grekas
+ */
+class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface
+{
+ private $requestFactory;
+ private $responseFactory;
+ private $serverRequestFactory;
+ private $streamFactory;
+ private $uploadedFileFactory;
+ private $uriFactory;
+
+ public function __construct(
+ RequestFactoryInterface $requestFactory = null,
+ ResponseFactoryInterface $responseFactory = null,
+ ServerRequestFactoryInterface $serverRequestFactory = null,
+ StreamFactoryInterface $streamFactory = null,
+ UploadedFileFactoryInterface $uploadedFileFactory = null,
+ UriFactoryInterface $uriFactory = null
+ ) {
+ $this->requestFactory = $requestFactory;
+ $this->responseFactory = $responseFactory;
+ $this->serverRequestFactory = $serverRequestFactory;
+ $this->streamFactory = $streamFactory;
+ $this->uploadedFileFactory = $uploadedFileFactory;
+ $this->uriFactory = $uriFactory;
+
+ $this->setFactory($requestFactory);
+ $this->setFactory($responseFactory);
+ $this->setFactory($serverRequestFactory);
+ $this->setFactory($streamFactory);
+ $this->setFactory($uploadedFileFactory);
+ $this->setFactory($uriFactory);
+ }
+
+ /**
+ * @param UriInterface|string $uri
+ */
+ public function createRequest(string $method, $uri): RequestInterface
+ {
+ $factory = $this->requestFactory ?? $this->setFactory(Psr17FactoryDiscovery::findRequestFactory());
+
+ return $factory->createRequest(...\func_get_args());
+ }
+
+ public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
+ {
+ $factory = $this->responseFactory ?? $this->setFactory(Psr17FactoryDiscovery::findResponseFactory());
+
+ return $factory->createResponse(...\func_get_args());
+ }
+
+ /**
+ * @param UriInterface|string $uri
+ */
+ public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface
+ {
+ $factory = $this->serverRequestFactory ?? $this->setFactory(Psr17FactoryDiscovery::findServerRequestFactory());
+
+ return $factory->createServerRequest(...\func_get_args());
+ }
+
+ public function createServerRequestFromGlobals(array $server = null, array $get = null, array $post = null, array $cookie = null, array $files = null, StreamInterface $body = null): ServerRequestInterface
+ {
+ $server = $server ?? $_SERVER;
+ $request = $this->createServerRequest($server['REQUEST_METHOD'] ?? 'GET', $this->createUriFromGlobals($server), $server);
+
+ return $this->buildServerRequestFromGlobals($request, $server, $files ?? $_FILES)
+ ->withQueryParams($get ?? $_GET)
+ ->withParsedBody($post ?? $_POST)
+ ->withCookieParams($cookie ?? $_COOKIE)
+ ->withBody($body ?? $this->createStreamFromFile('php://input', 'r+'));
+ }
+
+ public function createStream(string $content = ''): StreamInterface
+ {
+ $factory = $this->streamFactory ?? $this->setFactory(Psr17FactoryDiscovery::findStreamFactory());
+
+ return $factory->createStream($content);
+ }
+
+ public function createStreamFromFile(string $filename, string $mode = 'r'): StreamInterface
+ {
+ $factory = $this->streamFactory ?? $this->setFactory(Psr17FactoryDiscovery::findStreamFactory());
+
+ return $factory->createStreamFromFile($filename, $mode);
+ }
+
+ /**
+ * @param resource $resource
+ */
+ public function createStreamFromResource($resource): StreamInterface
+ {
+ $factory = $this->streamFactory ?? $this->setFactory(Psr17FactoryDiscovery::findStreamFactory());
+
+ return $factory->createStreamFromResource($resource);
+ }
+
+ public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null): UploadedFileInterface
+ {
+ $factory = $this->uploadedFileFactory ?? $this->setFactory(Psr17FactoryDiscovery::findUploadedFileFactory());
+
+ return $factory->createUploadedFile(...\func_get_args());
+ }
+
+ public function createUri(string $uri = ''): UriInterface
+ {
+ $factory = $this->uriFactory ?? $this->setFactory(Psr17FactoryDiscovery::findUriFactory());
+
+ return $factory->createUri(...\func_get_args());
+ }
+
+ public function createUriFromGlobals(array $server = null): UriInterface
+ {
+ return $this->buildUriFromGlobals($this->createUri(''), $server ?? $_SERVER);
+ }
+
+ private function setFactory($factory)
+ {
+ if (!$this->requestFactory && $factory instanceof RequestFactoryInterface) {
+ $this->requestFactory = $factory;
+ }
+ if (!$this->responseFactory && $factory instanceof ResponseFactoryInterface) {
+ $this->responseFactory = $factory;
+ }
+ if (!$this->serverRequestFactory && $factory instanceof ServerRequestFactoryInterface) {
+ $this->serverRequestFactory = $factory;
+ }
+ if (!$this->streamFactory && $factory instanceof StreamFactoryInterface) {
+ $this->streamFactory = $factory;
+ }
+ if (!$this->uploadedFileFactory && $factory instanceof UploadedFileFactoryInterface) {
+ $this->uploadedFileFactory = $factory;
+ }
+ if (!$this->uriFactory && $factory instanceof UriFactoryInterface) {
+ $this->uriFactory = $factory;
+ }
+
+ return $factory;
+ }
+
+ private function buildServerRequestFromGlobals(ServerRequestInterface $request, array $server, array $files): ServerRequestInterface
+ {
+ $request = $request
+ ->withProtocolVersion(isset($server['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $server['SERVER_PROTOCOL']) : '1.1')
+ ->withUploadedFiles($this->normalizeFiles($files));
+
+ $headers = [];
+ foreach ($server as $k => $v) {
+ if (0 === strpos($k, 'HTTP_')) {
+ $k = substr($k, 5);
+ } elseif (!\in_array($k, ['CONTENT_TYPE', 'CONTENT_LENGTH', 'CONTENT_MD5'], true)) {
+ continue;
+ }
+ $k = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $k))));
+
+ $headers[$k] = $v;
+ }
+
+ if (!isset($headers['Authorization'])) {
+ if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
+ $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
+ } elseif (isset($_SERVER['PHP_AUTH_USER'])) {
+ $headers['Authorization'] = 'Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].':'.($_SERVER['PHP_AUTH_PW'] ?? ''));
+ } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) {
+ $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST'];
+ }
+ }
+
+ foreach ($headers as $k => $v) {
+ try {
+ $request = $request->withHeader($k, $v);
+ } catch (\InvalidArgumentException $e) {
+ // ignore invalid headers
+ }
+ }
+
+ return $request;
+ }
+
+ private function buildUriFromGlobals(UriInterface $uri, array $server): UriInterface
+ {
+ $uri = $uri->withScheme(!empty($server['HTTPS']) && 'off' !== strtolower($server['HTTPS']) ? 'https' : 'http');
+
+ $hasPort = false;
+ if (isset($server['HTTP_HOST'])) {
+ $parts = parse_url('http://'.$server['HTTP_HOST']);
+
+ $uri = $uri->withHost($parts['host'] ?? 'localhost');
+
+ if ($parts['port'] ?? false) {
+ $hasPort = true;
+ $uri = $uri->withPort($parts['port']);
+ }
+ } else {
+ $uri = $uri->withHost($server['SERVER_NAME'] ?? $server['SERVER_ADDR'] ?? 'localhost');
+ }
+
+ if (!$hasPort && isset($server['SERVER_PORT'])) {
+ $uri = $uri->withPort($server['SERVER_PORT']);
+ }
+
+ $hasQuery = false;
+ if (isset($server['REQUEST_URI'])) {
+ $requestUriParts = explode('?', $server['REQUEST_URI'], 2);
+ $uri = $uri->withPath($requestUriParts[0]);
+ if (isset($requestUriParts[1])) {
+ $hasQuery = true;
+ $uri = $uri->withQuery($requestUriParts[1]);
+ }
+ }
+
+ if (!$hasQuery && isset($server['QUERY_STRING'])) {
+ $uri = $uri->withQuery($server['QUERY_STRING']);
+ }
+
+ return $uri;
+ }
+
+ private function normalizeFiles(array $files): array
+ {
+ foreach ($files as $k => $v) {
+ if ($v instanceof UploadedFileInterface) {
+ continue;
+ }
+ if (!\is_array($v)) {
+ unset($files[$k]);
+ } elseif (!isset($v['tmp_name'])) {
+ $files[$k] = $this->normalizeFiles($v);
+ } else {
+ $files[$k] = $this->createUploadedFileFromSpec($v);
+ }
+ }
+
+ return $files;
+ }
+
+ /**
+ * Create and return an UploadedFile instance from a $_FILES specification.
+ *
+ * @param array $value $_FILES struct
+ *
+ * @return UploadedFileInterface|UploadedFileInterface[]
+ */
+ private function createUploadedFileFromSpec(array $value)
+ {
+ if (!is_array($tmpName = $value['tmp_name'])) {
+ $file = is_file($tmpName) ? $this->createStreamFromFile($tmpName, 'r') : $this->createStream();
+
+ return $this->createUploadedFile($file, $value['size'], $value['error'], $value['name'], $value['type']);
+ }
+
+ foreach ($tmpName as $k => $v) {
+ $tmpName[$k] = $this->createUploadedFileFromSpec([
+ 'tmp_name' => $v,
+ 'size' => $value['size'][$k] ?? null,
+ 'error' => $value['error'][$k] ?? null,
+ 'name' => $value['name'][$k] ?? null,
+ 'type' => $value['type'][$k] ?? null,
+ ]);
+ }
+
+ return $tmpName;
+ }
+}
diff --git a/vendor/php-http/discovery/src/Psr18Client.php b/vendor/php-http/discovery/src/Psr18Client.php
new file mode 100644
index 0000000..c47780e
--- /dev/null
+++ b/vendor/php-http/discovery/src/Psr18Client.php
@@ -0,0 +1,45 @@
+
+ */
+class Psr18Client extends Psr17Factory implements ClientInterface
+{
+ private $client;
+
+ public function __construct(
+ ClientInterface $client = null,
+ RequestFactoryInterface $requestFactory = null,
+ ResponseFactoryInterface $responseFactory = null,
+ ServerRequestFactoryInterface $serverRequestFactory = null,
+ StreamFactoryInterface $streamFactory = null,
+ UploadedFileFactoryInterface $uploadedFileFactory = null,
+ UriFactoryInterface $uriFactory = null
+ ) {
+ parent::__construct($requestFactory, $responseFactory, $serverRequestFactory, $streamFactory, $uploadedFileFactory, $uriFactory);
+
+ $this->client = $client ?? Psr18ClientDiscovery::find();
+ }
+
+ public function sendRequest(RequestInterface $request): ResponseInterface
+ {
+ return $this->client->sendRequest($request);
+ }
+}
diff --git a/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php b/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php
index 8bddbe8..af63f88 100644
--- a/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php
+++ b/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php
@@ -12,7 +12,6 @@
use Http\Adapter\Guzzle6\Client as Guzzle6;
use Http\Adapter\Guzzle7\Client as Guzzle7;
use Http\Adapter\React\Client as React;
-use Http\Adapter\Zend\Client as Zend;
use Http\Client\Curl\Client as Curl;
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
@@ -25,7 +24,6 @@
use Http\Message\MessageFactory\DiactorosMessageFactory;
use Http\Message\MessageFactory\GuzzleMessageFactory;
use Http\Message\MessageFactory\SlimMessageFactory;
-use Http\Message\RequestFactory;
use Http\Message\StreamFactory;
use Http\Message\StreamFactory\DiactorosStreamFactory;
use Http\Message\StreamFactory\GuzzleStreamFactory;
@@ -41,12 +39,13 @@
use Slim\Http\Request as SlimRequest;
use Symfony\Component\HttpClient\HttplugClient as SymfonyHttplug;
use Symfony\Component\HttpClient\Psr18Client as SymfonyPsr18;
-use Zend\Diactoros\Request as ZendDiactorosRequest;
/**
* @internal
*
* @author Tobias Nyholm
+ *
+ * Don't miss updating src/Composer/Plugin.php when adding a new supported class.
*/
final class CommonClassesStrategy implements DiscoveryStrategy
{
@@ -57,33 +56,30 @@ final class CommonClassesStrategy implements DiscoveryStrategy
MessageFactory::class => [
['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]],
['class' => GuzzleMessageFactory::class, 'condition' => [GuzzleRequest::class, GuzzleMessageFactory::class]],
- ['class' => DiactorosMessageFactory::class, 'condition' => [ZendDiactorosRequest::class, DiactorosMessageFactory::class]],
['class' => DiactorosMessageFactory::class, 'condition' => [DiactorosRequest::class, DiactorosMessageFactory::class]],
['class' => SlimMessageFactory::class, 'condition' => [SlimRequest::class, SlimMessageFactory::class]],
],
StreamFactory::class => [
['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]],
['class' => GuzzleStreamFactory::class, 'condition' => [GuzzleRequest::class, GuzzleStreamFactory::class]],
- ['class' => DiactorosStreamFactory::class, 'condition' => [ZendDiactorosRequest::class, DiactorosStreamFactory::class]],
['class' => DiactorosStreamFactory::class, 'condition' => [DiactorosRequest::class, DiactorosStreamFactory::class]],
['class' => SlimStreamFactory::class, 'condition' => [SlimRequest::class, SlimStreamFactory::class]],
],
UriFactory::class => [
['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]],
['class' => GuzzleUriFactory::class, 'condition' => [GuzzleRequest::class, GuzzleUriFactory::class]],
- ['class' => DiactorosUriFactory::class, 'condition' => [ZendDiactorosRequest::class, DiactorosUriFactory::class]],
['class' => DiactorosUriFactory::class, 'condition' => [DiactorosRequest::class, DiactorosUriFactory::class]],
['class' => SlimUriFactory::class, 'condition' => [SlimRequest::class, SlimUriFactory::class]],
],
HttpAsyncClient::class => [
- ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, Promise::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]],
+ ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, Promise::class, [self::class, 'isPsr17FactoryInstalled']]],
['class' => Guzzle7::class, 'condition' => Guzzle7::class],
['class' => Guzzle6::class, 'condition' => Guzzle6::class],
['class' => Curl::class, 'condition' => Curl::class],
['class' => React::class, 'condition' => React::class],
],
HttpClient::class => [
- ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]],
+ ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, [self::class, 'isPsr17FactoryInstalled']]],
['class' => Guzzle7::class, 'condition' => Guzzle7::class],
['class' => Guzzle6::class, 'condition' => Guzzle6::class],
['class' => Guzzle5::class, 'condition' => Guzzle5::class],
@@ -92,7 +88,6 @@ final class CommonClassesStrategy implements DiscoveryStrategy
['class' => Buzz::class, 'condition' => Buzz::class],
['class' => React::class, 'condition' => React::class],
['class' => Cake::class, 'condition' => Cake::class],
- ['class' => Zend::class, 'condition' => Zend::class],
['class' => Artax::class, 'condition' => Artax::class],
[
'class' => [self::class, 'buzzInstantiate'],
diff --git a/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php b/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php
index fc26778..3e1c29b 100644
--- a/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php
+++ b/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php
@@ -13,6 +13,8 @@
* @internal
*
* @author Tobias Nyholm
+ *
+ * Don't miss updating src/Composer/Plugin.php when adding a new supported class.
*/
final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
{
@@ -23,7 +25,6 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
RequestFactoryInterface::class => [
'Phalcon\Http\Message\RequestFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
- 'Zend\Diactoros\RequestFactory',
'GuzzleHttp\Psr7\HttpFactory',
'Http\Factory\Diactoros\RequestFactory',
'Http\Factory\Guzzle\RequestFactory',
@@ -34,7 +35,6 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
ResponseFactoryInterface::class => [
'Phalcon\Http\Message\ResponseFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
- 'Zend\Diactoros\ResponseFactory',
'GuzzleHttp\Psr7\HttpFactory',
'Http\Factory\Diactoros\ResponseFactory',
'Http\Factory\Guzzle\ResponseFactory',
@@ -45,7 +45,6 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
ServerRequestFactoryInterface::class => [
'Phalcon\Http\Message\ServerRequestFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
- 'Zend\Diactoros\ServerRequestFactory',
'GuzzleHttp\Psr7\HttpFactory',
'Http\Factory\Diactoros\ServerRequestFactory',
'Http\Factory\Guzzle\ServerRequestFactory',
@@ -56,7 +55,6 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
StreamFactoryInterface::class => [
'Phalcon\Http\Message\StreamFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
- 'Zend\Diactoros\StreamFactory',
'GuzzleHttp\Psr7\HttpFactory',
'Http\Factory\Diactoros\StreamFactory',
'Http\Factory\Guzzle\StreamFactory',
@@ -67,7 +65,6 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
UploadedFileFactoryInterface::class => [
'Phalcon\Http\Message\UploadedFileFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
- 'Zend\Diactoros\UploadedFileFactory',
'GuzzleHttp\Psr7\HttpFactory',
'Http\Factory\Diactoros\UploadedFileFactory',
'Http\Factory\Guzzle\UploadedFileFactory',
@@ -78,7 +75,6 @@ final class CommonPsr17ClassesStrategy implements DiscoveryStrategy
UriFactoryInterface::class => [
'Phalcon\Http\Message\UriFactory',
'Nyholm\Psr7\Factory\Psr17Factory',
- 'Zend\Diactoros\UriFactory',
'GuzzleHttp\Psr7\HttpFactory',
'Http\Factory\Diactoros\UriFactory',
'Http\Factory\Guzzle\UriFactory',
diff --git a/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php b/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php
index c1e1fb7..6b3a862 100644
--- a/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php
+++ b/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php
@@ -11,6 +11,7 @@
* Find candidates using Puli.
*
* @internal
+ *
* @final
*
* @author David de Boer
diff --git a/vendor/php-http/httplug/CHANGELOG.md b/vendor/php-http/httplug/CHANGELOG.md
index 26483c2..efccd55 100644
--- a/vendor/php-http/httplug/CHANGELOG.md
+++ b/vendor/php-http/httplug/CHANGELOG.md
@@ -7,7 +7,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
-## [Unreleased]
+## [2.4.0] - 2023-04-14
+
+### Changed
+
+- Allow `psr/http-message` v2 in addition to v1
+- Deprecate `Http\Client\HttpClient`, use [PSR-18](https://www.php-fig.org/psr/psr-18/) instead
## [2.3.0] - 2022-02-21
diff --git a/vendor/php-http/httplug/README.md b/vendor/php-http/httplug/README.md
index ce60cfa..a9b476a 100644
--- a/vendor/php-http/httplug/README.md
+++ b/vendor/php-http/httplug/README.md
@@ -15,19 +15,11 @@
## Intro
HTTP client standard built on [PSR-7](http://www.php-fig.org/psr/psr-7/) HTTP
-messages. The HTTPlug client interface is compatible with the official standard
-for the HTTP client interface, [PSR-18](http://www.php-fig.org/psr/psr-18/).
-HTTPlug adds an interface for asynchronous HTTP requests, which PSR-18 does not
-cover.
-
-Since HTTPlug has already been widely adopted and a whole ecosystem has been
-built around it, we will keep maintaining this package for the time being.
-HTTPlug 2.0 and newer extend the PSR-18 interface to allow for a convenient
-migration path.
-
-New client implementations and consumers should use the PSR-18 interfaces
-directly. In the long term, we expect PSR-18 to completely replace the need
-for HTTPlug.
+messages. The HttpAsyncClient defines an asynchronous HTTP client for PHP.
+
+This package also provides a synchronous HttpClient interface with the same
+method signature as the [PSR-18](http://www.php-fig.org/psr/psr-18/) client.
+For synchronous requests, we recommend using PSR-18 directly.
## History
diff --git a/vendor/php-http/httplug/composer.json b/vendor/php-http/httplug/composer.json
index 268b27e..7391770 100644
--- a/vendor/php-http/httplug/composer.json
+++ b/vendor/php-http/httplug/composer.json
@@ -22,16 +22,11 @@
"php": "^7.1 || ^8.0",
"php-http/promise": "^1.1",
"psr/http-client": "^1.0",
- "psr/http-message": "^1.0"
+ "psr/http-message": "^1.0 || ^2.0"
},
"require-dev": {
- "friends-of-phpspec/phpspec-code-coverage": "^4.1",
- "phpspec/phpspec": "^5.1 || ^6.0"
- },
- "extra": {
- "branch-alias": {
- "dev-master": "2.x-dev"
- }
+ "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0",
+ "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0"
},
"autoload": {
"psr-4": {
diff --git a/vendor/php-http/httplug/src/HttpClient.php b/vendor/php-http/httplug/src/HttpClient.php
index 4442bd0..22b94aa 100644
--- a/vendor/php-http/httplug/src/HttpClient.php
+++ b/vendor/php-http/httplug/src/HttpClient.php
@@ -9,6 +9,8 @@
*
* Provide the Httplug HttpClient interface for BC.
* You should typehint Psr\Http\Client\ClientInterface in new code
+ *
+ * @deprecated since version 2.4, use Psr\Http\Client\ClientInterface instead; see https://www.php-fig.org/psr/psr-18/
*/
interface HttpClient extends ClientInterface
{
diff --git a/vendor/php-http/message-factory/CHANGELOG.md b/vendor/php-http/message-factory/CHANGELOG.md
deleted file mode 100644
index 4711924..0000000
--- a/vendor/php-http/message-factory/CHANGELOG.md
+++ /dev/null
@@ -1,65 +0,0 @@
-# Change Log
-
-
-## 1.0.2 - 2015-12-19
-
-### Added
-
-- Request and Response factory binding types to Puli
-
-
-## 1.0.1 - 2015-12-17
-
-### Added
-
-- Puli configuration and binding types
-
-
-## 1.0.0 - 2015-12-15
-
-### Added
-
-- Response Factory in order to be reused in Message and Server Message factories
-- Request Factory
-
-### Changed
-
-- Message Factory extends Request and Response factories
-
-
-## 1.0.0-RC1 - 2015-12-14
-
-### Added
-
-- CS check
-
-### Changed
-
-- RuntimeException is thrown when the StreamFactory cannot write to the underlying stream
-
-
-## 0.3.0 - 2015-11-16
-
-### Removed
-
-- Client Context Factory
-- Factory Awares and Templates
-
-
-## 0.2.0 - 2015-11-16
-
-### Changed
-
-- Reordered the parameters when creating a message to have the protocol last,
-as its the least likely to need to be changed.
-
-
-## 0.1.0 - 2015-06-01
-
-### Added
-
-- Initial release
-
-### Changed
-
-- Helpers are renamed to templates
diff --git a/vendor/php-http/message-factory/LICENSE b/vendor/php-http/message-factory/LICENSE
deleted file mode 100644
index 8e2c4a0..0000000
--- a/vendor/php-http/message-factory/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2015 PHP HTTP Team
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/vendor/php-http/message-factory/README.md b/vendor/php-http/message-factory/README.md
deleted file mode 100644
index 4654495..0000000
--- a/vendor/php-http/message-factory/README.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# PSR-7 Message Factory
-
-[![Latest Version](https://img.shields.io/github/release/php-http/message-factory.svg?style=flat-square)](https://github.com/php-http/message-factory/releases)
-[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
-[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message-factory.svg?style=flat-square)](https://packagist.org/packages/php-http/message-factory)
-
-**Factory interfaces for PSR-7 HTTP Message.**
-
-
-## Install
-
-Via Composer
-
-``` bash
-$ composer require php-http/message-factory
-```
-
-
-## Documentation
-
-Please see the [official documentation](http://php-http.readthedocs.org/en/latest/message-factory/).
-
-
-## Contributing
-
-Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.
-
-
-## Security
-
-If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org).
-
-
-## License
-
-The MIT License (MIT). Please see [License File](LICENSE) for more information.
diff --git a/vendor/php-http/message-factory/composer.json b/vendor/php-http/message-factory/composer.json
deleted file mode 100644
index 7c72feb..0000000
--- a/vendor/php-http/message-factory/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "php-http/message-factory",
- "description": "Factory interfaces for PSR-7 HTTP Message",
- "license": "MIT",
- "keywords": ["http", "factory", "message", "stream", "uri"],
- "homepage": "http://php-http.org",
- "authors": [
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com"
- }
- ],
- "require": {
- "php": ">=5.4",
- "psr/http-message": "^1.0"
- },
- "autoload": {
- "psr-4": {
- "Http\\Message\\": "src/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- }
-}
diff --git a/vendor/php-http/message-factory/puli.json b/vendor/php-http/message-factory/puli.json
deleted file mode 100644
index 08d3762..0000000
--- a/vendor/php-http/message-factory/puli.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "version": "1.0",
- "binding-types": {
- "Http\\Message\\MessageFactory": {
- "description": "PSR-7 Message Factory",
- "parameters": {
- "depends": {
- "description": "Optional class dependency which can be checked by consumers"
- }
- }
- },
- "Http\\Message\\RequestFactory": {
- "parameters": {
- "depends": {
- "description": "Optional class dependency which can be checked by consumers"
- }
- }
- },
- "Http\\Message\\ResponseFactory": {
- "parameters": {
- "depends": {
- "description": "Optional class dependency which can be checked by consumers"
- }
- }
- },
- "Http\\Message\\StreamFactory": {
- "description": "PSR-7 Stream Factory",
- "parameters": {
- "depends": {
- "description": "Optional class dependency which can be checked by consumers"
- }
- }
- },
- "Http\\Message\\UriFactory": {
- "description": "PSR-7 URI Factory",
- "parameters": {
- "depends": {
- "description": "Optional class dependency which can be checked by consumers"
- }
- }
- }
- }
-}
diff --git a/vendor/php-http/message-factory/src/MessageFactory.php b/vendor/php-http/message-factory/src/MessageFactory.php
deleted file mode 100644
index 965aaa8..0000000
--- a/vendor/php-http/message-factory/src/MessageFactory.php
+++ /dev/null
@@ -1,12 +0,0 @@
-
- */
-interface MessageFactory extends RequestFactory, ResponseFactory
-{
-}
diff --git a/vendor/php-http/message-factory/src/RequestFactory.php b/vendor/php-http/message-factory/src/RequestFactory.php
deleted file mode 100644
index 624e82f..0000000
--- a/vendor/php-http/message-factory/src/RequestFactory.php
+++ /dev/null
@@ -1,34 +0,0 @@
-
- */
-interface RequestFactory
-{
- /**
- * Creates a new PSR-7 request.
- *
- * @param string $method
- * @param string|UriInterface $uri
- * @param array $headers
- * @param resource|string|StreamInterface|null $body
- * @param string $protocolVersion
- *
- * @return RequestInterface
- */
- public function createRequest(
- $method,
- $uri,
- array $headers = [],
- $body = null,
- $protocolVersion = '1.1'
- );
-}
diff --git a/vendor/php-http/message-factory/src/ResponseFactory.php b/vendor/php-http/message-factory/src/ResponseFactory.php
deleted file mode 100644
index 2411ed3..0000000
--- a/vendor/php-http/message-factory/src/ResponseFactory.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
- */
-interface ResponseFactory
-{
- /**
- * Creates a new PSR-7 response.
- *
- * @param int $statusCode
- * @param string|null $reasonPhrase
- * @param array $headers
- * @param resource|string|StreamInterface|null $body
- * @param string $protocolVersion
- *
- * @return ResponseInterface
- */
- public function createResponse(
- $statusCode = 200,
- $reasonPhrase = null,
- array $headers = [],
- $body = null,
- $protocolVersion = '1.1'
- );
-}
diff --git a/vendor/php-http/message-factory/src/StreamFactory.php b/vendor/php-http/message-factory/src/StreamFactory.php
deleted file mode 100644
index 327a902..0000000
--- a/vendor/php-http/message-factory/src/StreamFactory.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
- */
-interface StreamFactory
-{
- /**
- * Creates a new PSR-7 stream.
- *
- * @param string|resource|StreamInterface|null $body
- *
- * @return StreamInterface
- *
- * @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/vendor/php-http/message-factory/src/UriFactory.php b/vendor/php-http/message-factory/src/UriFactory.php
deleted file mode 100644
index f05e625..0000000
--- a/vendor/php-http/message-factory/src/UriFactory.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
- */
-interface UriFactory
-{
- /**
- * Creates an PSR-7 URI.
- *
- * @param string|UriInterface $uri
- *
- * @return UriInterface
- *
- * @throws \InvalidArgumentException If the $uri argument can not be converted into a valid URI.
- */
- public function createUri($uri);
-}
diff --git a/vendor/php-http/message/.php-cs-fixer.dist.php b/vendor/php-http/message/.php-cs-fixer.dist.php
new file mode 100644
index 0000000..472cc1e
--- /dev/null
+++ b/vendor/php-http/message/.php-cs-fixer.dist.php
@@ -0,0 +1,18 @@
+in(__DIR__.'/src')
+ ->in(__DIR__.'/spec')
+ ->name('*.php')
+;
+
+$config = new PhpCsFixer\Config();
+
+return $config
+ ->setRiskyAllowed(true)
+ ->setRules([
+ '@Symfony' => true,
+ 'single_line_throw' => false,
+ ])
+ ->setFinder($finder)
+;
diff --git a/vendor/php-http/message/CHANGELOG.md b/vendor/php-http/message/CHANGELOG.md
index a185f46..096ee0c 100644
--- a/vendor/php-http/message/CHANGELOG.md
+++ b/vendor/php-http/message/CHANGELOG.md
@@ -1,4 +1,4 @@
-# Change Log
+# Changelog
All notable changes to this project will be documented in this file.
@@ -6,6 +6,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [1.16.0] - 2023-05-17
+
+- Remove direct dependency on `php-http/message-factory` as it is only needed for the deprecated Httplug factories.
+ Upgrade to PSR-17 message factories provided by your HTTP client implementation.
+ If you need the Httplug factories for the time being, you can `composer require php-http/message-factory` in your application.
+
+## [1.15.0] - 2023-05-10
+
+**If you use the decorator classes, you might need to adjust your code to the parameter and return type declarations added in PSR-7**
+
+- Actually make compatible with PSR-7 1.1 and 2.0
+- Drop support for PHP 7.1
+
+## [1.14.0] - 2023-04-14 (broken)
+
+**This release is not actually compatible with PSR-7 1.1 or 2.0**
+
+- Allow installation with http-message (PSR-7) version 2 in addition to version 1.
+- Support for PHP 8.2
+
## [1.13.0] - 2022-02-11
- Added `Formatter::formatResponseForRequest()` to allow the formatter to get context from the request to decide what of the response to output.
diff --git a/vendor/php-http/message/README.md b/vendor/php-http/message/README.md
index df1a7d5..7699b91 100644
--- a/vendor/php-http/message/README.md
+++ b/vendor/php-http/message/README.md
@@ -2,7 +2,7 @@
[![Latest Version](https://img.shields.io/github/release/php-http/message.svg?style=flat-square)](https://github.com/php-http/message/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
-[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/php-http/message/CI?style=flat-square)](https://github.com/php-http/message/actions?query=workflow%3ACI+branch%3Amaster)
+[![tests](https://github.com/php-http/message/actions/workflows/ci.yml/badge.svg)](https://github.com/php-http/message/actions/workflows/ci.yml)
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message.svg?style=flat-square)](https://packagist.org/packages/php-http/message)
**HTTP Message related tools.**
diff --git a/vendor/php-http/message/composer.json b/vendor/php-http/message/composer.json
index 1a614df..37a86a7 100644
--- a/vendor/php-http/message/composer.json
+++ b/vendor/php-http/message/composer.json
@@ -15,10 +15,9 @@
}
],
"require": {
- "php": "^7.1 || ^8.0",
+ "php": "^7.2 || ^8.0",
"clue/stream-filter": "^1.5",
- "php-http/message-factory": "^1.0.2",
- "psr/http-message": "^1.0"
+ "psr/http-message": "^1.1 || ^2.0"
},
"provide": {
"php-http/message-factory-implementation": "1.0"
@@ -26,10 +25,11 @@
"require-dev": {
"ext-zlib": "*",
"ergebnis/composer-normalize": "^2.6",
- "guzzlehttp/psr7": "^1.0",
+ "guzzlehttp/psr7": "^1.0 || ^2.0",
+ "php-http/message-factory": "^1.0.2",
"phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
"slim/slim": "^3.0",
- "laminas/laminas-diactoros": "^2.0"
+ "laminas/laminas-diactoros": "^2.0 || ^3.0"
},
"suggest": {
"ext-zlib": "Used with compressor/decompressor streams",
@@ -43,11 +43,6 @@
"ergebnis/composer-normalize": true
}
},
- "extra": {
- "branch-alias": {
- "dev-master": "1.10-dev"
- }
- },
"autoload": {
"psr-4": {
"Http\\Message\\": "src/"
diff --git a/vendor/php-http/message/src/Authentication/Wsse.php b/vendor/php-http/message/src/Authentication/Wsse.php
index f343633..88c266b 100644
--- a/vendor/php-http/message/src/Authentication/Wsse.php
+++ b/vendor/php-http/message/src/Authentication/Wsse.php
@@ -3,7 +3,6 @@
namespace Http\Message\Authentication;
use Http\Message\Authentication;
-use InvalidArgumentException;
use Psr\Http\Message\RequestInterface;
/**
@@ -38,7 +37,7 @@ public function __construct($username, $password, $hashAlgorithm = 'sha1')
$this->username = $username;
$this->password = $password;
if (false === in_array($hashAlgorithm, hash_algos())) {
- throw new InvalidArgumentException(sprintf('Unaccepted hashing algorithm: %s', $hashAlgorithm));
+ throw new \InvalidArgumentException(sprintf('Unaccepted hashing algorithm: %s', $hashAlgorithm));
}
$this->hashAlgorithm = $hashAlgorithm;
}
diff --git a/vendor/php-http/message/src/Cookie.php b/vendor/php-http/message/src/Cookie.php
index 0cc2d43..c6eaf51 100644
--- a/vendor/php-http/message/src/Cookie.php
+++ b/vendor/php-http/message/src/Cookie.php
@@ -399,8 +399,6 @@ public function withHttpOnly($httpOnly)
*
* This does not compare the values, only name, domain and path.
*
- * @param Cookie $cookie
- *
* @return bool
*/
public function match(self $cookie)
diff --git a/vendor/php-http/message/src/CookieJar.php b/vendor/php-http/message/src/CookieJar.php
index 914ad97..165084d 100644
--- a/vendor/php-http/message/src/CookieJar.php
+++ b/vendor/php-http/message/src/CookieJar.php
@@ -10,7 +10,7 @@
final class CookieJar implements \Countable, \IteratorAggregate
{
/**
- * @var \SplObjectStorage