TrustedCallbackInterface.php

Same filename and directory in other branches
  1. 9 core/lib/Drupal/Core/Security/TrustedCallbackInterface.php
  2. 8.9.x core/lib/Drupal/Core/Security/TrustedCallbackInterface.php
  3. 10 core/lib/Drupal/Core/Security/TrustedCallbackInterface.php

Namespace

Drupal\Core\Security

File

core/lib/Drupal/Core/Security/TrustedCallbackInterface.php

View source
<?php

namespace Drupal\Core\Security;


/**
 * Interface to declare trusted callbacks.
 *
 * @see \Drupal\Core\Security\DoTrustedCallbackTrait
 */
interface TrustedCallbackInterface {
    
    /**
     * Untrusted callbacks throw exceptions.
     */
    const THROW_EXCEPTION = 'exception';
    
    /**
     * 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();

}

Interfaces

Title Deprecated Summary
TrustedCallbackInterface Interface to declare trusted callbacks.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.