Skip to content

Commit c99d4f1

Browse files
committed
align addLoaders with addRequestHandlers
1 parent 32757f6 commit c99d4f1

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/Server/Builder.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,23 @@ public function addPrompt(
434434
}
435435

436436
/**
437-
* @param LoaderInterface[] $loaders
437+
* Register a single custom loader.
438438
*/
439-
public function addLoaders(...$loaders): self
439+
public function addLoader(LoaderInterface $loader): self
440440
{
441-
$this->loaders = [...$this->loaders, ...$loaders];
441+
$this->loaders[] = $loader;
442+
443+
return $this;
444+
}
445+
446+
/**
447+
* @param iterable<LoaderInterface> $loaders
448+
*/
449+
public function addLoaders(iterable $loaders): self
450+
{
451+
foreach ($loaders as $loader) {
452+
$this->loaders = [$loader];
453+
}
442454

443455
return $this;
444456
}

0 commit comments

Comments
 (0)