configFactory = $config_factory; } /** * {@inheritdoc} */ public function validate($module) { $reasons = []; $config = $this->configFactory->get('charts.settings'); $dependent_modules = $config->get('dependencies.module') ?? []; if (in_array($module, $dependent_modules)) { $reasons[] = $this->t('Provides a chart library or chart type plugin configured as the default option for chart. Please update the configuration or reset them before uninstalling it.'); } return $reasons; } }