public function resolveCallback(array $config)
    {
        if (count($config) < 1) {
            throw new \InvalidArgumentException('Cannot resolve empty callback');
        }

        if (!isset($config[1]) || is_array($config[1])) {
            $callable = $config[0];
            $arguments = $config[1] ?? [];
        } else {
            $callable = [$this->resolveInstance($config), $config[1]];
            $arguments = $config[2] ?? [];
        }

        return [
            'callback' => $callable,
            'arguments' => $arguments,
        ];
    }
public function resolveCallback(array $config)
    {
        if (count($config) < 1) {
            throw new \InvalidArgumentException('Cannot resolve empty callback');
        }

        if (!isset($config[1]) || is_array($config[1])) {
            $callable = $config[0];
            $arguments = $config[1] ?? [];
        } else {
            $callable = [$this->resolveInstance($config), $config[1]];
            $arguments = $config[2] ?? [];
        }

        return [
            'callback' => $callable,
            'arguments' => $arguments,
        ];
    }
@param array $config

@return array

@throws \InvalidArgumentException