Skip to content

Commit 9ccc158

Browse files
committed
Syntax update
1 parent 6380f5c commit 9ccc158

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Alias/Alias.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function remove(string $index, string $alias): bool
6666

6767
public function runActions(array $actions): Response
6868
{
69-
$response = $this->client->getBaseClient()->post('_aliases', $actions);
69+
$response = $this->client->getBaseClient()->post('_aliases', ['actions' => $actions]);
7070

7171
if ($response->clientError()) {
7272
$this->client->throwUpdateResponseException(
@@ -93,14 +93,14 @@ public function replace(string $alias, string $newIndex, ?string $oldIndex = nul
9393
$response = $this->runActions([
9494
[
9595
'add' => [
96-
'index' => $alias,
97-
'alias' => $newIndex,
96+
'index' => $newIndex,
97+
'alias' => $alias,
9898
]
9999
],
100100
[
101101
'remove' => [
102-
'index' => $alias,
103-
'alias' => $oldIndex,
102+
'index' => $oldIndex,
103+
'alias' => $alias,
104104
]
105105
]
106106
]);

src/Index/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(private readonly ClientInterface $client = new Clien
1919
*/
2020
public function create(string $name, array $settings = []): bool
2121
{
22-
$response = $this->client->getBaseClient()->put($name, $settings);
22+
$response = $this->client->getBaseClient()->put($name, (object) $settings);
2323

2424
if ($response->clientError()) {
2525
$this->client->throwUpdateResponseException(

0 commit comments

Comments
 (0)