You are here

function _coder_style_closing_php_callback in Coder 6.2

Define the rule callbacks for style.

1 string reference to '_coder_style_closing_php_callback'
coder_style_reviews in includes/coder_style.inc
Implementation of hook_reviews().

File

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

Code

function _coder_style_closing_php_callback(&$coder_args, $review, $rule, $lines, &$results) {
  if (empty($lines)) {
    return;
  }
  for ($lineno = -1; $last = array_slice($lines, $lineno); $lineno--) {
    $lastline = $last[0][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($results, $rule, $severity_name, count($lines));
  }
}