src/Core/Controller/AbstractController.php
protected function delegate($task, ...$args)
    {
        if (method_exists($this, $task)) {
            return $this->container->call([$this, $task], $args, $this);
        }

        if (is_callable($task)) {
            return $this->container->call($task, $args, $this);
        }

        throw new \LogicException('Task: ' . $task . ' not found.');
    }
protected function delegate($task, ...$args)
    {
        if (method_exists($this, $task)) {
            return $this->container->call([$this, $task], $args, $this);
        }

        if (is_callable($task)) {
            return $this->container->call($task, $args, $this);
        }

        throw new \LogicException('Task: ' . $task . ' not found.');
    }
protected function delegate ( $ task , ... $ args ) { if ( method_exists ( $ this , $ task ) ) { return $ this -> container -> call ( [ $ this , $ task ] , $ args , $ this ) ; } if ( is_callable ( $ task ) ) { return $ this -> container -> call ( $ task , $ args , $ this ) ; } throw new \ LogicException ( 'Task: ' . $ task . ' not found.' ) ; }
Method to easily distribute task to other methods that we can process different tasks.

Example in doExecute():
```
return $this->delegate($this->input->get('task'), `arg1`, `arg2`);

// OR

return $this->delegate([$object, 'method'], `arg1`, `arg2`);
```

@param   string $task The task name.
@param   array  $args The arguments we provides.

@return mixed
@throws \ReflectionException
@throws \Windwalker\DI\Exception\DependencyResolutionException
Method to easily distribute task to other methods that we can process different tasks .