You are here

public function SiteAuditCheckExtensionsUpdate::getResultWarn in Site Audit 7

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

Overrides SiteAuditCheckAbstract::getResultWarn

File

Check/Extensions/Update.php, line 46
Contains \SiteAudit\Check\Extensions\Update.

Class

SiteAuditCheckExtensionsUpdate
Class SiteAuditCheckExtensionsUpdate.

Code

public function getResultWarn() {
  $ret_val = 'The following project(s) have updates available:';
  if (drush_get_option('html')) {
    $ret_val = '<p>' . $ret_val . '</p>';
    $ret_val .= '<table class="table table-condensed">';
    $ret_val .= '<thead><tr><th>' . dt('Name') . '</th><th>' . dt('Existing') . '</th><th>' . dt('Candidate') . '</th><th>' . dt('Status') . '</th></thead>';
    $ret_val .= '<tbody>';
    foreach ($this->registry['projects_update'] as $short_info) {
      $ret_val .= '<tr>';
      $ret_val .= '<td>' . $short_info['label'] . '</td>';
      $ret_val .= '<td>' . $short_info['existing_version'] . '</td>';
      $ret_val .= '<td>' . $short_info['candidate_version'] . '</td>';
      $ret_val .= '<td>' . $short_info['status_msg'] . '</td>';
      $ret_val .= '</tr>';
    }
    $ret_val .= '</tbody>';
    $ret_val .= '</table>';
  }
  else {
    foreach ($this->registry['projects_update'] as $short_info) {
      $ret_val .= PHP_EOL;
      if (!drush_get_option('json')) {
        $ret_val .= str_repeat(' ', 6);
      }
      $ret_val .= "- {$short_info['label']}: {$short_info['existing_version']} to {$short_info['candidate_version']} - {$short_info['status_msg']}";
    }
  }
  return $ret_val;
}