Skip to content

Commit

Permalink
Fix invoker signature
Browse files Browse the repository at this point in the history
An array may be passed
  • Loading branch information
dmolineus committed Oct 9, 2024
1 parent a25e1e6 commit 30cab03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Callback/Invoker.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public function __construct(private readonly Adapter $systemAdapter)
/**
* Handle the callback.
*
* @param callable $callback Callback as Contao array notation or as PHP callable.
* @param list<mixed> $arguments List of arguments being passed to the callback.
* @param callable|array{0: string,1: string} $callback Callback as Contao array notation or as PHP callable.
* @param list<mixed> $arguments List of arguments being passed to the callback.
*
* @throws InvalidArgumentException On callback is not callable.
*/
public function invoke(callable $callback, array $arguments = []): mixed
public function invoke(callable|array $callback, array $arguments = []): mixed
{
if (is_array($callback)) {
$callback[0] = $this->systemAdapter->importStatic($callback[0]);
Expand Down

0 comments on commit 30cab03

Please sign in to comment.