function _coder_error_msg in Coder 5.2
Same name and namespace in other branches
- 5 coder.module \_coder_error_msg()
Does the actual saving of error to results array and generating its unique numeric id.
Parameters
$results: Results array variable to save errors to.
$warning: Warning array/string to be themed, returned from '#warning_callback' or is a translated string from the rule. See theme_coder_warning() for array format.
$severity_name: String severity of error.
$lineno: Integer line number error occured on.
$line: String line contents.
3 calls to _coder_error_msg()
- do_coder_reviews in ./
coder.module - Perform batch coder reviews for multiple files.
- _coder_error in ./
coder.module - Builds an error message based on the rule that failed and other information.
- _coder_style_callback in includes/
coder_style.inc - Define the rule callbacks for style.
File
- ./
coder.module, line 1345 - Developer Module that assists with code review and version upgrade that supports a plug-in extensible hook system so contributed modules can define additional review standards.
Code
function _coder_error_msg(&$results, $warning, $severity_name, $lineno = -1, $line = '') {
// Note: The use of the $key allows multiple errors on one line.
// This assumes that no line of source has more than 10000 lines of code
// and that we have fewer than 10000 errors.
global $_coder_errno;
$key = ($lineno + 1) * 10000 + $_coder_errno++;
$results[$key] = theme('coder_warning', $warning, $severity_name, $lineno + 1, $line);
$results['#stats'][$severity_name]++;
}