StaticTrustedCallbackHelper
class StaticTrustedCallbackHelper (View source)
Defines a class for performing trusted callbacks in a static context.
Traits
Ensures that TrustedCallbackInterface can be enforced for callback methods.
Methods
Performs a callback.
Performs a callback.
Details
mixed
doTrustedCallback(callable $callback, array $args, $message, string $error_type = TrustedCallbackInterface::THROW_EXCEPTION, string $extra_trusted_interface = NULL)
Performs a callback.
If the callback is trusted the callback will occur. Trusted callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or $extra_trusted_interface or be an anonymous function. If the callback is not trusted then whether or not the callback is called and what type of error is thrown depends on $error_type. To provide time for dependent code to use trusted callbacks use TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION and then at a later date change this to TrustedCallbackInterface::THROW_EXCEPTION.
static mixed
callback(callable $callback, array $args, string $message, string $error_type = TrustedCallbackInterface::THROW_EXCEPTION, string $extra_trusted_interface = NULL)
Performs a callback.