You are here

function _coder_review_7x_comment_doxygen_file_callback in Coder 7.2

@todo: add a function header comment.

1 string reference to '_coder_review_7x_comment_doxygen_file_callback'
coder_review_7x_reviews in coder_review/includes/coder_review_7x.inc
Implements hook_reviews().

File

coder_review/includes/coder_review_7x.inc, line 1396
This include file implements coder functionality for 6.x -> 7.x upgrades.

Code

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

  // @NOTE: no simpletest for this.
  // Only perform this check on install files.
  $pathinfo = pathinfo($coder_args['#filename']);
  if ($pathinfo['extension'] == 'install') {
    $file_found = 0;
    $invalid_file_message = 0;
    foreach ($lines as $lineno => $line) {
      if (preg_match('/^ * @file/', $line[0])) {
        $file_found = 1;
      }
      elseif ($file_found == 1) {
        if (!preg_match('/^ * Install, update and uninstall functions for the \\w+ module./', $line[0])) {
          $invalid_file_message = 1;
        }
        $file_found = 0;
      }
    }
    if ($invalid_file_message) {
      $severity_name = _coder_review_severity_name($coder_args, $review, $rule);
      $tmprule = $rule;
      $tmprule['#warning'] = array(
        '#text' => 'For .install files, the @file description should be of the format "Install, update and uninstall functions for the XXX module.".',
        '#link' => _drupalnode(224333, 'afile'),
      );
      _coder_review_error($results, $tmprule, $severity_name, $theme_lineno, $theme_line, $coder_args['#ignores']);
    }
  }
}