You are here

interface TrustedCallbackInterface in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Security/TrustedCallbackInterface.php \Drupal\Core\Security\TrustedCallbackInterface

Interface to declare trusted callbacks.

Hierarchy

Expanded class hierarchy of TrustedCallbackInterface

All classes that implement TrustedCallbackInterface

See also

\Drupal\Core\Security\DoTrustedCallbackTrait

36 files declare their use of TrustedCallbackInterface
AccountForm.php in core/modules/user/src/AccountForm.php
AddFormBase.php in core/modules/media_library/src/Form/AddFormBase.php
BigPipeRegressionTestController.php in core/modules/big_pipe/tests/modules/big_pipe_regression_test/src/BigPipeRegressionTestController.php
BigPipeTestController.php in core/modules/big_pipe/tests/modules/big_pipe_test/src/BigPipeTestController.php
BlockViewBuilder.php in core/modules/block/src/BlockViewBuilder.php

... See full list

File

core/lib/Drupal/Core/Security/TrustedCallbackInterface.php, line 10

Namespace

Drupal\Core\Security
View source
interface TrustedCallbackInterface {

  /**
   * Untrusted callbacks throw exceptions.
   */
  const THROW_EXCEPTION = 'exception';

  /**
   * Untrusted callbacks trigger E_USER_WARNING errors.
   */
  const TRIGGER_WARNING = 'warning';

  /**
   * Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
   */
  const TRIGGER_SILENCED_DEPRECATION = 'silenced_deprecation';

  /**
   * Lists the trusted callbacks provided by the implementing class.
   *
   * Trusted callbacks are public methods on the implementing class and can be
   * invoked via
   * \Drupal\Core\Security\DoTrustedCallbackTrait::doTrustedCallback().
   *
   * @return string[]
   *   List of method names implemented by the class that can be used as trusted
   *   callbacks.
   *
   * @see \Drupal\Core\Security\DoTrustedCallbackTrait::doTrustedCallback()
   */
  public static function trustedCallbacks();

}

Members

Namesort descending Modifiers Type Description Overrides
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.
TrustedCallbackInterface::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. 34