Fix: Use correct deprecation_info for Twig callables #3064
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Twig v.3.15. introduced some nice features. Testing it with Timber v.2.x. works fine. However, there is this annoying deprecation warning:
$options['deprecated']
is deprecated since Twig 3.15.From Changelog:
* Improve the way one can deprecate a Twig callable (use
deprecation_info
instead of the other callable options)https://github.com/twigphp/Twig/blob/709fc6abcef276d40581be663c120307ccf0f2ce/src/AbstractTwigCallable.php#L46
Solution
updates Timber to use the new deprecation_info option introduced in Twig 3.15 for handling deprecate 8000 d features.
Question:
Why was the deprecated option used to signal Twig in the first place when Timber already provides the Helper::deprecated() function to handle deprecation warnings? This seems redundant, as Helper::deprecated() outputs its own warning messages. Or am I missing something?
Impact
Usage Changes
Considerations
Testing