You are here

function _coder_review_5x_callback in Coder 7.2

Same name and namespace in other branches
  1. 7 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 142
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).
  $pathinfo = pathinfo(realpath($coder_args['#filename']));
  if ($pathinfo['extension'] == 'module') {

    // Make sure that a .info file exists.
    if (!file_exists($pathinfo['dirname'] . '/' . $pathinfo['filename'] . '.info')) {
      $severity_name = _coder_review_severity_name($coder_args, $review, $rule);
      _coder_review_error($results, $rule, $severity_name);
    }
  }
}