You are here

function _coder_review_5x_callback in Coder 7

Same name and namespace in other branches
  1. 7.2 coder_review/includes/coder_review_5x.inc \_coder_review_5x_callback()

Define the rule callbacks for 5.x, see do_coder_review_review_callback().

1 string reference to '_coder_review_5x_callback'
coder_review_5x_reviews in coder_review/includes/coder_review_5x.inc
Implements hook_reviews().

File

coder_review/includes/coder_review_5x.inc, line 85
This include file implements coder_review functionality for 4.7 -> 5.x upgrades.

Code

function _coder_review_5x_callback(&$coder_args, $review, $rule, $lines, &$results) {

  // Only perform this check on module's (not includes).
  $filename = $coder_args['#filename'];
  if (drupal_substr($filename, -7) == '.module') {

    // Make sure that a .info file exists.
    $filename = drupal_substr(realpath($filename), 0, -7) . '.info';
    if (!file_exists($filename)) {
      $severity_name = _coder_review_severity_name($coder_args, $review, $rule);
      _coder_review_error($results, $rule, $severity_name);
    }
  }
}