You are here

class ReportingHandlerBase in Content-Security-Policy 8

Base Reporting Handler implementation.

Hierarchy

Expanded class hierarchy of ReportingHandlerBase

4 files declare their use of ReportingHandlerBase
None.php in src/Plugin/CspReportingHandler/None.php
ReportUri.php in src/Plugin/CspReportingHandler/ReportUri.php
SiteLog.php in src/Plugin/CspReportingHandler/SiteLog.php
Uri.php in src/Plugin/CspReportingHandler/Uri.php

File

src/Plugin/ReportingHandlerBase.php, line 11

Namespace

Drupal\csp\Plugin
View source
class ReportingHandlerBase implements ReportingHandlerInterface {

  /**
   * The Plugin Configuration.
   *
   * @var array
   */
  protected $configuration;

  /**
   * The Plugin ID.
   *
   * @var string
   */
  protected $pluginId;

  /**
   * The Plugin Definition.
   *
   * @var array
   */
  protected $pluginDefinition;

  /**
   * Reporting Handler plugin constructor.
   *
   * @param array $configuration
   *   The Plugin configuration.
   * @param string $plugin_id
   *   The Plugin ID.
   * @param mixed $plugin_definition
   *   The Plugin Definition.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition) {
    $this->configuration = $configuration;
    $this->pluginId = $plugin_id;
    $this->pluginDefinition = $plugin_definition;
  }

  /**
   * {@inheritdoc}
   */
  public function getForm(array $form) {
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function validateForm(array &$form, FormStateInterface $form_state) {
  }

  /**
   * {@inheritdoc}
   */
  public function alterPolicy(Csp $policy) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ReportingHandlerBase::$configuration protected property The Plugin Configuration.
ReportingHandlerBase::$pluginDefinition protected property The Plugin Definition.
ReportingHandlerBase::$pluginId protected property The Plugin ID.
ReportingHandlerBase::alterPolicy public function Alter the provided policy according to the plugin settings. Overrides ReportingHandlerInterface::alterPolicy 3
ReportingHandlerBase::getForm public function Get the form fields for configuring this reporting handler. Overrides ReportingHandlerInterface::getForm 2
ReportingHandlerBase::validateForm public function Validate the form fields of this report handler. Overrides ReportingHandlerInterface::validateForm 2
ReportingHandlerBase::__construct public function Reporting Handler plugin constructor.