You are here

function coder_upgrade_upgrade_call_taxonomy_form_all_alter in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_upgrade/conversions/call.inc \coder_upgrade_upgrade_call_taxonomy_form_all_alter()

Implements hook_upgrade_call_taxonomy_form_all_alter().

File

coder_upgrade/conversions/call.inc, line 2343
Provides conversion routines applied to function calls.

Code

function coder_upgrade_upgrade_call_taxonomy_form_all_alter(&$node, &$reader) {
  cdp(__FUNCTION__);

  // Create helper objects.
  $editor = PGPEditor::getInstance();

  // Get the function call object.
  $item =& $node->data;
  $item
    ->insertStatementBefore($editor
    ->commentToStatement('// TODO taxonomy_form_all has been removed, use an autocomplete field instead.'));

  // Replace function call with array().
  // This is an example of deleting a function call reference.
  $string = str_replace(array(
    '/*',
    '*/',
  ), '', $item
    ->toString());
  $temp = $editor
    ->expressionToStatement("array() /* {$string} */");
  $node->container
    ->insertListBefore($node, $temp);
  $node->container
    ->delete($node);
}