X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FAnalyzer%2FDB.php;fp=web%2Fmodules%2Fcontrib%2Fdrupalmoduleupgrader%2Fsrc%2FPlugin%2FDMU%2FAnalyzer%2FDB.php;h=349be46293bead5f66d322d73236d633f5c10f01;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/DB.php b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/DB.php new file mode 100644 index 000000000..349be4629 --- /dev/null +++ b/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Analyzer/DB.php @@ -0,0 +1,53 @@ +getIndexer('function_call') + ->get($this->pluginDefinition['function'] ?: $this->getPluginId()) + ->filter(function(FunctionCallNode $function_call) { + $arguments = $function_call->getArguments(); + return $arguments[0] instanceof StringNode && in_array($arguments[0]->toValue(), self::$forbiddenTables); + }); + + $issues = []; + if ($function_calls->count() > 0) { + $issue = $this->buildIssue($target); + $function_calls->each(function(FunctionCallNode $function_call) use ($issue) { + $issue->addViolation($function_call, $this); + }); + $issues[] = $issue; + } + + return $issues; + } + +}