5 * Contains \Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer\Define.
8 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer;
10 use Drupal\Component\Serialization\Yaml as YAML;
11 use Drupal\Component\Utility\NestedArray;
12 use Drupal\drupalmoduleupgrader\FixerBase;
19 class Define extends FixerBase {
21 public function execute() {
22 $file = $this->getUnaliasedPath($this->configuration['in']);
23 $data = file_exists($file) ? YAML::decode(file_get_contents($file)) : [];
24 $keys = explode('/', $this->configuration['key']);
25 NestedArray::setValue($data, $keys, $this->configuration['value']);
26 file_put_contents($file, YAML::encode($data));