public static function getInstance(string $class, array $params = [])
    {
        if (!class_exists($class)) {
            throw new InvalidArgumentException("Class [$class] does not exist");
        }

        if (empty($params)) {
            return new $class;
        }

        $reflection = new ReflectionClass($class);

        return $reflection->newInstanceArgs($params);
    }