public static function get(string $name, ContainerInterface $container = null, bool $throwException = true)
    {
        if ($container === null) {
            $container = static::$container;
        }

        if ($container !== null && $container->has($name)) {
            return static::$container->get($name);
        }

        if ($throwException) {
            throw new InvalidConfigException("No '$name' service can be found");
        } else {
            return null;
        }
    }