By andypost on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
11.1.x
Introduced in version:
11.1.0
Issue links:
Description:
Trusted callbacks allow classes to specify which methods can safely be called as (for example) lazy builders.
Since 10.1.0, trusted callbacks could be declared using method attributes with only one line of code.
Since 11.1.0, TrustedCallbackInterface::trustedCallbacks() is now deprecated and implementations should use the attribute instead. The interface will be removed in Drupal 12.0.0.
Note that if you are overriding trusted callbacks, previously you had to make no additional adjustments as the method name was implicitly trusted; you should now apply the attribute to all overrides of trusted methods as well.
Impacts:
Module developers