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

Define missing macros variable in constructor #4416

Closed
wants to merge 1 commit into from

Commits on Oct 24, 2024

  1. Define missing macros variable in constructor

    When defining a macro in a template, the constructor looks like this:
    
    ```php
        public function __construct(\Twig\Environment $env)
        {
            parent::__construct($env);
            $this->source = $this->getSourceContext();
            $this->parent = \false;
            $this->blocks = [];
            $macros["_self"] = $this->macros["_self"] = $this;
        }
    ```
    
    The `$macros` variable does not exist resulting in:
    
    Implicit array creation is not allowed - variable $macros does not exist.
    ruudk committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    9c17aa4 View commit details
    Browse the repository at this point in the history