function _coder_style_callback in Coder 5.2
Same name and namespace in other branches
- 5 includes/coder_style.inc \_coder_style_callback()
- 6 includes/coder_style.inc \_coder_style_callback()
Define the rule callbacks for style.
1 string reference to '_coder_style_callback'
- coder_style_reviews in includes/
coder_style.inc - Implementation of hook_reviews().
File
- includes/
coder_style.inc, line 158 - 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));
}
}