You are here

public function SiteAuditCheckCachePageExpire::calculateScore in Site Audit 8.2

Same name and namespace in other branches
  1. 7 Check/Cache/PageExpire.php \SiteAuditCheckCachePageExpire::calculateScore()

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

Overrides SiteAuditCheckAbstract::calculateScore

File

Check/Cache/PageExpire.php, line 72
Contains \SiteAudit\Check\Cache\PageExpire.

Class

SiteAuditCheckCachePageExpire
Class SiteAuditCheckCachePageExpire.

Code

public function calculateScore() {
  $config = \Drupal::config('system.performance')
    ->get('cache.page.max_age');
  if ($config == 0) {
    if (site_audit_env_is_dev()) {
      return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
    }
    return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_FAIL;
  }
  elseif ($config >= 900) {
    return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS;
  }
  return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_WARN;
}