Skip to content

Commit 79b7281

Browse files
committed
Fix builder magic method call
1 parent 596d4a7 commit 79b7281

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/IndexBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class IndexBuilder
136136
*/
137137
public function __call(string $name, array $arguments): self
138138
{
139-
$calls = ['set' => true, 'add' => false, 'withAdded' => false, 'with' => false];
139+
$calls = ['set' => true, 'add' => false, 'withAdded' => false, 'with' => true];
140140
foreach ($calls as $type => $singleArgument) {
141141
$result = $this->doCall($type, $name, true === $singleArgument ? $arguments[0] ?? null : $arguments);
142142
if ($result instanceof IndexBuilder) {
@@ -262,7 +262,7 @@ private function withCall(string $name, $argument): self
262262
{
263263
$newInstance = clone $this;
264264

265-
return $newInstance->{'set'.$name}($name, $argument);
265+
return $newInstance->{'set'.$name}($argument);
266266
}
267267

268268
/**
@@ -276,7 +276,7 @@ private function withAddedCall(string $name, array $arguments): self
276276
{
277277
$newInstance = clone $this;
278278

279-
return $newInstance->{'add'.$name}($name, $arguments);
279+
return $newInstance->{'add'.$name}($arguments);
280280
}
281281

282282
/**

0 commit comments

Comments
 (0)