You are here

function hook_upgrade_call_FUNCTION_NAME_alter in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_upgrade/coder_upgrade.api.php \hook_upgrade_call_FUNCTION_NAME_alter()

Alters a function call using the grammar parser.

This hook allows contributed modules to alter a function call object using the grammar parser. The function call may be a stand-alone statement or part of an expression in another statement. For example:

foo($bar);

// Stand-alone.
if (foo($bar)) {

  // Embedded.
  // Do something.
}

Coder Upgrade will call this alter hook for each function call in the file that was parsed. However, the function name must be a string, not a variable expression. To modify the latter, use hook_upgrade_file_alter(). Refer to the grammar parser documentation for details of the function call object.

Parameters

PGPFunctionCall $node: A node object containing a function call object.

PGPReader $reader: The object containing the grammar statements of the file to convert.

See also

hook_upgrade_file_alter()

PGPFunctionCall

72 functions implement hook_upgrade_call_FUNCTION_NAME_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

coder_upgrade_upgrade_call_actions_synchronize_alter in coder_upgrade/conversions/call.inc
Implements hook_upgrade_call_actions_synchronize_alter().
coder_upgrade_upgrade_call_book_toc_alter in coder_upgrade/conversions/call.inc
Implements hook_upgrade_call_book_toc_alter().
coder_upgrade_upgrade_call_check_markup_alter in coder_upgrade/conversions/call.inc
Implements hook_upgrade_call_check_markup_alter().
coder_upgrade_upgrade_call_comment_node_url_alter in coder_upgrade/conversions/call.inc
Implements hook_upgrade_call_comment_node_url_alter().
coder_upgrade_upgrade_call_comment_validate_alter in coder_upgrade/conversions/call.inc
Implements hook_upgrade_call_comment_validate_alter().

... See full list

File

coder_upgrade/coder_upgrade.api.php, line 83
Documents hooks provided by this module.

Code

function hook_upgrade_call_FUNCTION_NAME_alter(&$node, &$reader) {

  // Get the function call object.
  $item =& $node->data;

  // Change the function name.
  $item->name['value'] = 'new_name';
  if ($item
    ->parameterCount() > 0) {

    // Delete the first parameter.
    $item
      ->deleteParameter();
  }
}