You are here

function _security_review_drush_findings_output in Security Review 7

1 call to _security_review_drush_findings_output()
_security_review_drush_format_result in ./security_review.drush.inc
Helper function to format Security Review results.

File

./security_review.drush.inc, line 236
Drush commands for Security Review module.

Code

function _security_review_drush_findings_output($check) {
  $findings = array();
  if (isset($check['help'])) {
    $findings[] = $check['help'];
  }
  elseif (isset($check['callback'])) {
    if (isset($check['file'])) {

      // Handle Security Review defining checks for other modules.
      if (isset($check['module'])) {
        $module = $check['module'];
      }
      module_load_include('inc', $module, $check['file']);
    }
    $function = $check['callback'] . '_help';
    if (function_exists($function)) {
      $element = $function($check);
      if (is_array($element['findings']['items'])) {
        foreach ($element['findings']['items'] as $item) {
          if (is_array($item) && isset($item['raw'])) {
            $findings[] = $item['raw'];
          }
        }
      }
    }
  }
  return $findings;
}