You are here

ViewsEnabled.php in Site Audit 8.3

File

src/Plugin/SiteAuditCheck/ViewsEnabled.php
View source
<?php

namespace Drupal\site_audit\Plugin\SiteAuditCheck;

use Drupal\site_audit\Plugin\SiteAuditCheckBase;

/**
 * Provides the ViewsEnabled Check.
 *
 * @SiteAuditCheck(
 *  id = "views_enabled",
 *  name = @Translation("Views status"),
 *  description = @Translation("Check to see if enabled"),
 *  report = "views",
 *  weight = -5,
 * )
 */
class ViewsEnabled extends SiteAuditCheckBase {

  /**
   * {@inheritdoc}.
   */
  public function getResultFail() {
  }

  /**
   * {@inheritdoc}.
   */
  public function getResultInfo() {
    return $this
      ->t('Views is not enabled.');
  }

  /**
   * {@inheritdoc}.
   */
  public function getResultPass() {
    return $this
      ->t('Views is enabled.');
  }

  /**
   * {@inheritdoc}.
   */
  public function getResultWarn() {
  }

  /**
   * {@inheritdoc}.
   */
  public function getAction() {
  }

  /**
   * {@inheritdoc}.
   */
  public function calculateScore() {
    if (!\Drupal::moduleHandler()
      ->moduleExists('views')) {
      $this->abort = TRUE;
      return SiteAuditCheckBase::AUDIT_CHECK_SCORE_INFO;
    }
    return SiteAuditCheckBase::AUDIT_CHECK_SCORE_PASS;
  }

}

Classes

Namesort descending Description
ViewsEnabled Provides the ViewsEnabled Check.