Skip to content

Commit

Permalink
feat: use transport package
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Sep 8, 2024
1 parent 1866e6e commit 5be2b8d
Show file tree
Hide file tree
Showing 38 changed files with 151 additions and 4,756 deletions.
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

0 comments on commit 5be2b8d

Please sign in to comment.