summaryrefslogtreecommitdiff
path: root/vendor/open-telemetry/sdk/Common/Http
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/open-telemetry/sdk/Common/Http')
-rw-r--r--vendor/open-telemetry/sdk/Common/Http/DependencyResolverInterface.php13
-rw-r--r--vendor/open-telemetry/sdk/Common/Http/HttpPlug/Client/ResolverInterface.php12
-rw-r--r--vendor/open-telemetry/sdk/Common/Http/Psr/Client/ResolverInterface.php12
-rw-r--r--vendor/open-telemetry/sdk/Common/Http/Psr/Message/FactoryResolverInterface.php22
-rw-r--r--vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactory.php52
-rw-r--r--vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactoryInterface.php13
6 files changed, 124 insertions, 0 deletions
diff --git a/vendor/open-telemetry/sdk/Common/Http/DependencyResolverInterface.php b/vendor/open-telemetry/sdk/Common/Http/DependencyResolverInterface.php
new file mode 100644
index 000000000..824335213
--- /dev/null
+++ b/vendor/open-telemetry/sdk/Common/Http/DependencyResolverInterface.php
@@ -0,0 +1,13 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTelemetry\SDK\Common\Http;
+
+use OpenTelemetry\SDK\Common\Http\HttpPlug\Client\ResolverInterface as HttpPlugClientResolverInterface;
+use OpenTelemetry\SDK\Common\Http\Psr\Client\ResolverInterface as PsrClientResolverInterface;
+use OpenTelemetry\SDK\Common\Http\Psr\Message\FactoryResolverInterface;
+
+interface DependencyResolverInterface extends FactoryResolverInterface, PsrClientResolverInterface, HttpPlugClientResolverInterface
+{
+}
diff --git a/vendor/open-telemetry/sdk/Common/Http/HttpPlug/Client/ResolverInterface.php b/vendor/open-telemetry/sdk/Common/Http/HttpPlug/Client/ResolverInterface.php
new file mode 100644
index 000000000..3b2f4d53e
--- /dev/null
+++ b/vendor/open-telemetry/sdk/Common/Http/HttpPlug/Client/ResolverInterface.php
@@ -0,0 +1,12 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTelemetry\SDK\Common\Http\HttpPlug\Client;
+
+use Http\Client\HttpAsyncClient;
+
+interface ResolverInterface
+{
+ public function resolveHttpPlugAsyncClient(): HttpAsyncClient;
+}
diff --git a/vendor/open-telemetry/sdk/Common/Http/Psr/Client/ResolverInterface.php b/vendor/open-telemetry/sdk/Common/Http/Psr/Client/ResolverInterface.php
new file mode 100644
index 000000000..ba028e38a
--- /dev/null
+++ b/vendor/open-telemetry/sdk/Common/Http/Psr/Client/ResolverInterface.php
@@ -0,0 +1,12 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTelemetry\SDK\Common\Http\Psr\Client;
+
+use Psr\Http\Client\ClientInterface;
+
+interface ResolverInterface
+{
+ public function resolvePsrClient(): ClientInterface;
+}
diff --git a/vendor/open-telemetry/sdk/Common/Http/Psr/Message/FactoryResolverInterface.php b/vendor/open-telemetry/sdk/Common/Http/Psr/Message/FactoryResolverInterface.php
new file mode 100644
index 000000000..4582e19ce
--- /dev/null
+++ b/vendor/open-telemetry/sdk/Common/Http/Psr/Message/FactoryResolverInterface.php
@@ -0,0 +1,22 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTelemetry\SDK\Common\Http\Psr\Message;
+
+use Psr\Http\Message\RequestFactoryInterface;
+use Psr\Http\Message\ResponseFactoryInterface;
+use Psr\Http\Message\ServerRequestFactoryInterface;
+use Psr\Http\Message\StreamFactoryInterface;
+use Psr\Http\Message\UploadedFileFactoryInterface;
+use Psr\Http\Message\UriFactoryInterface;
+
+interface FactoryResolverInterface
+{
+ public function resolveRequestFactory(): RequestFactoryInterface;
+ public function resolveResponseFactory(): ResponseFactoryInterface;
+ public function resolveServerRequestFactory(): ServerRequestFactoryInterface;
+ public function resolveStreamFactory(): StreamFactoryInterface;
+ public function resolveUploadedFileFactory(): UploadedFileFactoryInterface;
+ public function resolveUriFactory(): UriFactoryInterface;
+}
diff --git a/vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactory.php b/vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactory.php
new file mode 100644
index 000000000..8e99d64c0
--- /dev/null
+++ b/vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactory.php
@@ -0,0 +1,52 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTelemetry\SDK\Common\Http\Psr\Message;
+
+use Psr\Http\Message\RequestFactoryInterface;
+use Psr\Http\Message\RequestInterface;
+use Psr\Http\Message\ResponseFactoryInterface;
+use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\ServerRequestFactoryInterface;
+use Psr\Http\Message\ServerRequestInterface;
+
+final class MessageFactory implements MessageFactoryInterface
+{
+ private RequestFactoryInterface $requestFactory;
+ private ResponseFactoryInterface $responseFactory;
+ private ServerRequestFactoryInterface $serverRequestFactory;
+
+ public function __construct(
+ RequestFactoryInterface $requestFactory,
+ ResponseFactoryInterface $responseFactory,
+ ServerRequestFactoryInterface $serverRequestFactory
+ ) {
+ $this->requestFactory = $requestFactory;
+ $this->responseFactory = $responseFactory;
+ $this->serverRequestFactory = $serverRequestFactory;
+ }
+
+ public static function create(
+ RequestFactoryInterface $requestFactory,
+ ResponseFactoryInterface $responseFactory,
+ ServerRequestFactoryInterface $serverRequestFactory
+ ): self {
+ return new self($requestFactory, $responseFactory, $serverRequestFactory);
+ }
+
+ public function createRequest(string $method, $uri): RequestInterface
+ {
+ return $this->requestFactory->createRequest($method, $uri);
+ }
+
+ public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
+ {
+ return $this->responseFactory->createResponse($code, $reasonPhrase);
+ }
+
+ public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface
+ {
+ return $this->serverRequestFactory->createServerRequest($method, $uri, $serverParams);
+ }
+}
diff --git a/vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactoryInterface.php b/vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactoryInterface.php
new file mode 100644
index 000000000..97258491f
--- /dev/null
+++ b/vendor/open-telemetry/sdk/Common/Http/Psr/Message/MessageFactoryInterface.php
@@ -0,0 +1,13 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTelemetry\SDK\Common\Http\Psr\Message;
+
+use Psr\Http\Message\RequestFactoryInterface;
+use Psr\Http\Message\ResponseFactoryInterface;
+use Psr\Http\Message\ServerRequestFactoryInterface;
+
+interface MessageFactoryInterface extends RequestFactoryInterface, ServerRequestFactoryInterface, ResponseFactoryInterface
+{
+}