You are here

function _coder_50_callback in Coder 5

Same name and namespace in other branches
  1. 5.2 includes/coder_50.inc \_coder_50_callback()
  2. 6.2 includes/coder_50.inc \_coder_50_callback()
  3. 6 includes/coder_50.inc \_coder_50_callback()

Define the rule callbacks

1 string reference to '_coder_50_callback'
coder_50_reviews in includes/coder_50.inc
@file This include file implements coder functionality for 4.7 -> 5.0 upgrades

File

includes/coder_50.inc, line 81
This include file implements coder functionality for 4.7 -> 5.0 upgrades

Code

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

  // only perform this check on module's (not includes)
  $filename = $coder_args['#filename'];
  if (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_severity_name($coder_args, $review, $rule);
      $warning = t('All modules now need to have a <a href="@info">modulename.info file</a>', array(
        '@info' => 'http://drupal.org/node/101009',
      ));
      $results[0] = theme('coder_warning', $warning, $severity_name);
    }
  }
}