You are here

public function SiteAuditCheckBlockCacheReport::getCacheStateLabel in Site Audit 7

Render a block cache state.

Parameters

int $state: Drupal block caching state.

Return value

string Human readable label.

1 call to SiteAuditCheckBlockCacheReport::getCacheStateLabel()
SiteAuditCheckBlockCacheReport::calculateScore in Check/Block/CacheReport.php
Implements \SiteAudit\Check\Abstract\calculateScore().

File

Check/Block/CacheReport.php, line 125
Contains \SiteAudit\Check\Block\CacheReport.

Class

SiteAuditCheckBlockCacheReport
Class SiteAuditCheckBlockCacheReport.

Code

public function getCacheStateLabel($state) {
  $label = dt('Unknown');
  switch ($state) {
    case DRUPAL_NO_CACHE:
      $label = dt('None');
      break;
    case DRUPAL_CACHE_CUSTOM:
      $label = dt('Custom');
      break;
    case DRUPAL_CACHE_PER_ROLE:
      $label = dt('Role');
      break;
    case DRUPAL_CACHE_PER_USER:
      $label = dt('User');
      break;
    case DRUPAL_CACHE_PER_PAGE:
      $label = dt('Page');
      break;
    case DRUPAL_CACHE_GLOBAL:
      $label = dt('Global');
      break;
  }
  return $label;
}