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 · 7 comments
Open

Deprecated dynamic property in extensions #323

basteyy opened this issue Nov 4, 2023 · 7 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.

@o251298
Copy link

o251298 commented Jun 18, 2024

Good day. I would really like to use the library on Php 8.2))

@ChrisGalliano
Copy link

  Hi @reinink, do we have any chance to resolve this issue and achieve PHP 8.2 compatibility in the foreseeable future?

@delboy1978uk
Copy link

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!

basteyy added a commit to basteyy/plates-url-toolset that referenced this issue Jul 4, 2024
@ragboyjr
Copy link
Contributor

ragboyjr commented Nov 2, 2024

#329 - this should be fixed here.

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

6 participants