Skip to content

Support for variadic tool parameters #85

Description

@jarivehvilainen-rgb

There is also a TODO line about this in the code in RegisteredElement.php -> prepareArguments.

I extended the framework in my code and am currently overriding RegisteredElement.php file. I achieved what I need by doing the following:

in RegisteredElement.php::handle

if (is_callable($this->handler)) {
   $reflection = $this->getReflectionForCallable($this->handler);
   $arguments = $this->prepareArguments($reflection, $arguments, $context);
   return call_user_func($this->handler, ...$arguments);
}

is replaced with:

if (is_callable($this->handler)) {
   $reflection = $this->getReflectionForCallable($this->handler);
   return call_user_func($this->handler, $arguments);
}

but I am not versed enough to parametrize this in to the framework itself

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions