Deprecated dynamic property in extensions
Currently, the ExtensionInterface requires only one method (register). In L102 from Func.php , the script tries to assign the Template $template to the extension's variable $template. If strict mode is enabled, you will receive a Deprecated warning:
Deprecated: Creation of dynamic property SomeExtension::$template is deprecated in /var/www/html/vendor/league/plates/src/Template/Func.php on line 104
This can be fixed by adding the following to the extension:
public Template $template;
A better fix would be:
- Create an extendable
MasterExtensionclass with the variable defined within it. - Add a
setTemplatemethod to theExtensionInterfaceand allow the user to handle this themselves.
I have created a PR that will address this issue.
any movement on this?
@delboy1978uk No.
Good day. I would really like to use the library on Php 8.2))
Hi @reinink, do we have any chance to resolve this issue and achieve PHP 8.2 compatibility in the foreseeable future?
Guys, just add public Template $template; in your extension, it will work in PHP 8.2. Of course it would be better in the plates library itself but you don't need to wait on that!