You are here

function _coder_error in Coder 5

Same name and namespace in other branches
  1. 5.2 coder.module \_coder_error()
  2. 6.2 coder.module \_coder_error()
  3. 6 coder.module \_coder_error()
3 calls to _coder_error()
do_coder_review_grep in ./coder.module
Searches for a string.
do_coder_review_grep_invert in ./coder.module
Searches for potentially missing string.
do_coder_review_regex in ./coder.module

File

./coder.module, line 1060
Developer Module that assists with code review and version upgrade that supports a plug-in extensible hook system so contributed modules can define additional review standards.

Code

function _coder_error(&$results, $rule, $severity_name, $lineno = -1, $line = '', $original = '') {
  if (isset($rule['#warning_callback'])) {
    if (function_exists($rule['#warning_callback'])) {
      $warning = $rule['#warning_callback']();
    }
    else {

      // if this happens, there is an error in the rule definition
      $warning = t('please <a href="@report">report</a> this !warning', array(
        '@report' => 'http://drupal.org/node/add/project_issue/coder/bug',
        '!warning' => $rule['#warning_callback'],
      ));
    }
  }
  else {
    $warning = t($rule['#warning']);
  }
  return _coder_error_msg($results, $warning, $severity_name, $lineno, $line);
}