Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use transport package #228

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
],
"require": {
"php": "^7.3 || ^8.0",
"ext-json": ">=1.3.7",
"ext-curl": "*",
"ezimuel/ringphp": "^1.2.2",
"psr/log": "^1|^2|^3",
"symfony/yaml": "*"
"ext-json": ">=1.3.7",
"elastic/transport": "^8.10",
"psr/log": "^1|^2|^3"
},
"require-dev": {
"ext-zip": "*",
"symfony/yaml": "*",
"aws/aws-sdk-php": "^3.0",
"friendsofphp/php-cs-fixer": "^3.0",
"mockery/mockery": "^1.2",
Expand All @@ -54,7 +54,10 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"php-http/discovery": false
}
},
"scripts": {
"php-cs": [
Expand Down
7 changes: 3 additions & 4 deletions src/OpenSearch/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1891,11 +1891,10 @@ public function request(string $method, string $uri, array $attributes = [])
{
$params = $attributes['params'] ?? [];
$body = $attributes['body'] ?? null;
$options = $attributes['options'] ?? [];

$promise = $this->transport->performRequest($method, $uri, $params, $body, $options);
$promise = $this->transport->performRequest($method, $uri, $params, $body);

return $this->transport->resultOrFuture($promise, $options);
return $this->transport->resultOrFuture($promise);
}

/**
Expand All @@ -1911,6 +1910,6 @@ private function performRequest(AbstractEndpoint $endpoint)
$endpoint->getOptions()
);

return $this->transport->resultOrFuture($promise, $endpoint->getOptions());
return $this->transport->resultOrFuture($promise);
}
}
Loading
Loading