You are here

function _coder_severity in Coder 5

Same name and namespace in other branches
  1. 5.2 coder.module \_coder_severity()
  2. 6.2 coder.module \_coder_severity()
  3. 6 coder.module \_coder_severity()
1 call to _coder_severity()
do_coder_review in ./coder.module

File

./coder.module, line 940
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_severity($severity_name, $default_value = 5) {

  // NOTE: implemented this way in hopes that it is faster than a php switch
  if (!isset($severity_names)) {
    $severity_names = array(
      'minor' => 1,
      'normal' => 5,
      'critical' => 9,
    );
  }
  if (isset($severity_names[$severity_name])) {
    return $severity_names[$severity_name];
  }
  return $default_value;
}