Problem/Motivation
Running a test of an unrelated custom module on D11.4/PHP 8.3 results in this warning:
Method "Twig\Extension\ExtensionInterface::getFunctions()" might add "array" as a native return type declaration in the future. Do the same in implementation "Drupal\webform\Twig\WebformTwigExtension" now to avoid errors or add an explicit @return annotation to suppress this message.
Steps to reproduce
Test a custom or contrib module on D11.4/PHP 8.3
Proposed resolution
The interface in Twig 3.28.0 doesn't have a return value. You could add it there, add it to the webform method, add '@return', add 'ReturnTypeWillChange'...
Since this is such a small change it's probably best to incorporate into something else.
Issue fork webform-3612397
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
garvitasakhrani commentedAdded a native array return type to WebformTwigExtension::getFunctions() to address the deprecation warning. Verified the change locally. Please review. Thanks!
Comment #5
liam morlandThanks