You are here

public function HookPermission::convert in Drupal 7 to 8/9 Module Upgrader 8

Performs required conversions.

Parameters

TargetInterface $target: The target module to convert.

Overrides ConverterInterface::convert

File

src/Plugin/DMU/Converter/HookPermission.php, line 21

Class

HookPermission
Plugin annotation @Converter( id = "hook_permission", description = @Translation("Converts static implementations of hook_permission() to YAML."), hook = "hook_permission" )

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Converter

Code

public function convert(TargetInterface $target) {
  $permissions = $this
    ->executeHook($target, $this->pluginDefinition['hook']);
  $this
    ->writeInfo($target, 'permissions', $this
    ->castTranslatables($permissions));
}