You are here

protected function ConverterBase::writeInfo in Drupal 7 to 8/9 Module Upgrader 8

Writes out arbitrary data in YAML format.

@todo This should be writeYAML, not writeInfo.

Parameters

TargetInterface $target: The target module.

string $group: The name of the YAML file. It will be prefixed with the module's machine name and suffixed with .yml. For example, a group value of 'routing' will write MODULE.routing.yml.

array $data: The data to write.

7 calls to ConverterBase::writeInfo()
ConverterBase::writeService in src/ConverterBase.php
Writes a service definition to the target module's services.yml file.
CToolsGetPlugins::rewrite in src/Plugin/DMU/Converter/Functions/CToolsGetPlugins.php
Tries to rewrite the original function call.
HookLibrary::convert in src/Plugin/DMU/Converter/HookLibrary.php
Performs required conversions.
HookPermission::convert in src/Plugin/DMU/Converter/HookPermission.php
Performs required conversions.
InfoToYAML::convert in src/Plugin/DMU/Converter/InfoToYAML.php
Performs required conversions.

... See full list

File

src/ConverterBase.php, line 166

Class

ConverterBase
Base class for converters.

Namespace

Drupal\drupalmoduleupgrader

Code

protected function writeInfo(TargetInterface $target, $group, array $data) {
  $destination = $target
    ->getPath('.' . $group . '.yml');
  file_put_contents($destination, Yaml::encode($data));
}