You are here

public function SiteAuditCheckExtensionsUnused::getResultWarn in Unused Modules 7

Same name and namespace in other branches
  1. 8 unused_modules.site_audit.inc \SiteAuditCheckExtensionsUnused::getResultWarn()

Implements \SiteAudit\Check\Abstract\getResultWarn().

Overrides SiteAuditCheckAbstract::getResultWarn

File

./unused_modules.site_audit.inc, line 42
Contains \SiteAudit\Check\Extensions\Unused.

Class

SiteAuditCheckExtensionsUnused
@file Contains \SiteAudit\Check\Extensions\Unused.

Code

public function getResultWarn() {
  $ret_val = dt('The following projects(s) are not in use:');
  if (drush_get_option('html')) {
    $ret_val = '<p>' . $ret_val . '</p>';
    $ret_val .= '<table class="table table-condensed">';
    $ret_val .= '<thead><tr><th>Name</th><th>Path</th></thead>';
    $ret_val .= '<tbody>';
    foreach ($this->registry['unused_projects'] as $project_name => $project_path) {
      $ret_val .= '<tr><td>' . $project_name . '</td><td>' . $project_path . '</td></tr>';
    }
    $ret_val .= '</tbody>';
    $ret_val .= '</table>';
  }
  else {
    foreach ($this->registry['unused_projects'] as $project_name => $project_path) {
      $ret_val .= PHP_EOL . str_repeat(' ', 6);
      $ret_val .= "- {$project_name}: {$project_path}";
    }
  }
  return $ret_val;
}