Skip to content

Deprecated dynamic property in extensions #323

@basteyy

Description

@basteyy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions