HookToYAML.php in Drupal 7 to 8/9 Module Upgrader 8
File
src/Plugin/DMU/Fixer/HookToYAML.phpView source
<?php
namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer;
use Drupal\Component\Serialization\Yaml as YAML;
use Drupal\drupalmoduleupgrader\FixerBase;
/**
* @Fixer(
* id = "hook_to_YAML"
* )
*/
class HookToYAML extends FixerBase {
public function execute() {
$destination = $this
->getUnaliasedPath($this->configuration['destination']);
$data = $this->target
->executeHook($this->configuration['hook']);
file_put_contents($destination, YAML::encode($data));
}
}
Classes
Name | Description |
---|---|
HookToYAML | Plugin annotation @Fixer( id = "hook_to_YAML" ) |