You are here

public function WatchdogAge::getResultInfo in Site Audit 8.3

.

Overrides SiteAuditCheckBase::getResultInfo

File

src/Plugin/SiteAuditCheck/WatchdogAge.php, line 29

Class

WatchdogAge
Provides the WatchdogAge Check.

Namespace

Drupal\site_audit\Plugin\SiteAuditCheck

Code

public function getResultInfo() {

  // If two different days...
  if (date('Y-m-d', $this->ageOldest) != date('Y-m-d', $this->ageNewest)) {
    return $this
      ->t('From @from to @to (@days days)', [
      '@from' => date('r', $this->ageOldest),
      '@to' => date('r', $this->ageNewest),
      '@days' => round(($this->ageNewest - $this->ageOldest) / 86400, 2),
    ]);
  }

  // Same day; don't calculate number of days.
  return $this
    ->t('From @from to @to', [
    '@from' => date('r', $this->ageOldest),
    '@to' => date('r', $this->ageNewest),
  ]);
}