public static function invoke($object, $method, ...$params)
    {
        $method = self::getReflectionMethod($object, $method);

        if (is_string($object) || $method->isStatic()) {
            if (($declaringClass = $method->getDeclaringClass()->getName()) !== self::toClassName($object)) {
                return self::getReflectionMethod($declaringClass, $method->getName())->invokeArgs(null, $params);
            }

            return $method->invokeArgs(null, $params);
        }

        return $method->invokeArgs($object, $params);
    }