You are here

function _coder_style_callback in Coder 5

Same name and namespace in other branches
  1. 5.2 includes/coder_style.inc \_coder_style_callback()
  2. 6 includes/coder_style.inc \_coder_style_callback()

Define the rule callbacks

1 string reference to '_coder_style_callback'
coder_style_reviews in includes/coder_style.inc
@file This include file implements coder functionality for Drupal Standards

File

includes/coder_style.inc, line 126
This include file implements coder functionality for Drupal Standards

Code

function _coder_style_callback(&$coder_args, $review, $rule, $lines, &$results) {
  for ($lineno = -1; $last = array_slice($lines, $lineno); $lineno--) {
    $lastline = $last[0];
    if (preg_match('/\\S/', $lastline)) {
      break;
    }
  }
  if ($last && $lastline && preg_match('/\\?>\\s*$/i', $lastline)) {
    $severity_name = _coder_severity_name($coder_args, $review, $rule);
    _coder_error_msg($results, 'the final ?> should be omitted from all code files', $severity_name, count($lines));
  }
}