X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FConverter%2FFunctions%2FDisableDeriver.php;fp=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FConverter%2FFunctions%2FDisableDeriver.php;h=73aa6e93bf2074808e9fb8398237c9848aa44207;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/DisableDeriver.php b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/DisableDeriver.php new file mode 100644 index 000000000..73aa6e93b --- /dev/null +++ b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Functions/DisableDeriver.php @@ -0,0 +1,51 @@ +get('definitions'); + foreach ($config as $key => $info) { + // Only disable functions that have been explicitly marked for disabling. + if (empty($info['disable'])) { + continue; + } + + // $key can either be the name of a single function, or an arbitrary string + // identifying a group of functions to handle. + if (empty($info['functions'])) { + $info['functions'] = [$key]; + } + + foreach ($info['functions'] as $function) { + $derivative = $base_definition; + $variables = ['@function' => $function . '()']; + + $derivative['function'] = $function; + $derivative['description'] = $this->t('Disables calls to @function().', $variables); + if (isset($info['fixme'])) { + $derivative['fixme'] = $this->t($info['fixme'], $variables); + } + $derivative['documentation'] = $info['documentation']; + + $derivatives[$function] = $derivative; + } + } + + return $derivatives; + } + +}