| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace OpenSearch; |
| 6: | |
| 7: | |
| 8: | @trigger_error(LegacyTransportWrapper::class . ' is deprecated in 2.4.0 and will be removed in 3.0.0.', E_USER_DEPRECATED); |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | class LegacyTransportWrapper implements TransportInterface |
| 16: | { |
| 17: | public function __construct( |
| 18: | protected Transport $transport, |
| 19: | ) { |
| 20: | } |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | public function sendRequest( |
| 26: | string $method, |
| 27: | string $uri, |
| 28: | array $params = [], |
| 29: | mixed $body = null, |
| 30: | array $headers = [], |
| 31: | ): iterable|string|null { |
| 32: | |
| 33: | $options = $headers; |
| 34: | $promise = $this->transport->performRequest($method, $uri, $params, $body, $options); |
| 35: | return $this->transport->resultOrFuture($promise, $options); |
| 36: | } |
| 37: | |
| 38: | } |
| 39: | |