X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FAnalyzer%2FHookUninstall.php;fp=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FAnalyzer%2FHookUninstall.php;h=a6ff1207f8a14f10ea8a46eb81aa84d453bd9597;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/HookUninstall.php b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/HookUninstall.php new file mode 100644 index 000000000..a6ff1207f --- /dev/null +++ b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/HookUninstall.php @@ -0,0 +1,47 @@ +getIndexer('function'); + $issues = []; + + if ($indexer->has('hook_uninstall')) { + /** @var \Pharborist\NodeCollection $variable_del */ + $variable_del = $indexer->get('hook_uninstall')->find(Filter::isFunctionCall('variable_del')); + + if (sizeof($variable_del) > 0) { + $issue = $this->buildIssue($target); + $variable_del->each(function(FunctionCallNode $function_call) use ($issue) { + $issue->addViolation($function_call, $this); + }); + $issues[] = $issue; + } + } + + return $issues; + } + +}