You are here

public function ExtensionsUnrecommended::getResultFail in Site Audit 8.3

.

Overrides SiteAuditCheckBase::getResultFail

File

src/Plugin/SiteAuditCheck/ExtensionsUnrecommended.php, line 22

Class

ExtensionsUnrecommended
Provides the ExtensionsUnrecommended Check.

Namespace

Drupal\site_audit\Plugin\SiteAuditCheck

Code

public function getResultFail() {
  $ret_val = $this
    ->t('The following unrecommended modules(s) currently exist in your codebase: @list', [
    '@list' => implode(', ', array_keys($this->registry->extensions_unrec)),
  ]);

  // If ($this->options['detail']) {.
  if (TRUE) {

    // If ($this->options['html']) {.
    if (TRUE) {
      $ret_val .= '<br/>';
      $ret_val .= '<table class="table table-condensed">';
      $ret_val .= '<thead><tr><th>' . $this
        ->t('Name') . '</th><th>' . $this
        ->t('Reason') . '</th></thead>';
      $ret_val .= '<tbody>';
      foreach ($this->registry->extensions_unrec as $row) {
        $ret_val .= '<tr><td>' . implode('</td><td>', $row) . '</td></tr>';
      }
      $ret_val .= '</tbody>';
      $ret_val .= '</table>';
    }
    else {
      foreach ($this->registry->extensions_unrec as $row) {
        $ret_val .= PHP_EOL;
        if (!$this->options['json']) {
          $ret_val .= str_repeat(' ', 6);
        }
        $ret_val .= '- ' . $row[0] . ': ' . $row[1];
      }
    }
  }
  return $ret_val;
}