You are here

Last.php in Site Audit 8.2

Same filename and directory in other branches
  1. 7 Check/Cron/Last.php

Contains \SiteAudit\Check\Cron\Last.

File

Check/Cron/Last.php
View source
<?php

/**
 * @file
 * Contains \SiteAudit\Check\Cron\Last.
 */

/**
 * Class SiteAuditCheckCronLast.
 */
class SiteAuditCheckCronLast extends SiteAuditCheckAbstract {

  /**
   * Implements \SiteAudit\Check\Abstract\getLabel().
   */
  public function getLabel() {
    return dt('Last run');
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getDescription().
   */
  public function getDescription() {
    return dt('Time Cron last executed');
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getResultFail().
   */
  public function getResultFail() {
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getResultInfo().
   */
  public function getResultInfo() {
    if ($this->registry['cron_last']) {
      return dt('Cron last ran at @date (@ago ago)', array(
        '@date' => date('r', $this->registry['cron_last']),
        '@ago' => \Drupal::service('date.formatter')
          ->formatInterval(time() - $this->registry['cron_last']),
      ));
    }
    return dt('Cron has never run.');
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getResultPass().
   */
  public function getResultPass() {
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getResultWarn().
   */
  public function getResultWarn() {
  }

  /**
   * Implements \SiteAudit\Check\Abstract\getAction().
   */
  public function getAction() {
  }

  /**
   * Implements \SiteAudit\Check\Abstract\calculateScore().
   */
  public function calculateScore() {
    return SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO;
  }

}

Classes

Namesort descending Description
SiteAuditCheckCronLast Class SiteAuditCheckCronLast.