public function invoke($callable, array $namedParams = [], array $classParams = [])
    {
        $classParams = $this->reindexclassParams($classParams);

        if ($callable instanceof \Closure) {
            return $this->invokeFunction($callable, $namedParams, $classParams);
        }

        if (is_string($callable)) {
            if (strpos($callable, '::') !== false) {
                list($class, $method) = explode('::', $callable);
                return $this->invokeClassMethod($class, $method, $namedParams, $classParams);
            } else {
                return $this->invokeFunction($callable, $namedParams, $classParams);
            }
        }

        if (is_array($callable) && count($callable) == 2 && is_string($callable[1])) {
            if (is_object($callable[0])) {
                return $this->invokeObjectMethod($callable[0], $callable[1], $namedParams, $classParams);
            }

            if (is_string($callable[0])) {
                return $this->invokeClassMethod($callable[0], $callable[1], $namedParams, $classParams);
            }
        }

        throw new \InvalidArgumentException("Given argument is not callable.");
    }