Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated dynamic property in extensions #323

Open
basteyy opened this issue Nov 4, 2023 · 3 comments
Open

Deprecated dynamic property in extensions #323

basteyy opened this issue Nov 4, 2023 · 3 comments

Comments

@basteyy
Copy link

basteyy commented Nov 4, 2023

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:

  1. Create an extendable MasterExtension class with the variable defined within it.
  2. Add a setTemplate method to the ExtensionInterface and allow the user to handle this themselves.
@dsmithhayes
Copy link

I have created a PR that will address this issue.

@delboy1978uk
Copy link

any movement on this?

@dsmithhayes
Copy link

@delboy1978uk No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants