Skip to content

Commit

Permalink
minor #3886 Remove TemplateWrapper::render() 2nd parameter not used…
Browse files Browse the repository at this point in the history
… (GromNaN)

This PR was merged into the 3.x branch.

Discussion
----------

Remove `TemplateWrapper::render()` 2nd parameter not used

The 2nd virtual parameter of `TemplateWrapper::render()` was added by #2805.
`Template::render()` don't define and don't use this 2nd parameter.

Running the test suite, this method never get more than 1 parameter (I assumed it could be used by the compiled Template via the backtrace, but it isn't).

Commits
-------

c56b87b Remove TemplateWrapper::render 2nd parameter not used
  • Loading branch information
fabpot committed Oct 20, 2023
2 parents eaf22ba + c56b87b commit 78e5245
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/TemplateWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ public function __construct(Environment $env, Template $template)

public function render(array $context = []): string
{
// using func_get_args() allows to not expose the blocks argument
// as it should only be used by internal code
return $this->template->render($context, \func_get_args()[1] ?? []);
return $this->template->render($context);
}

public function display(array $context = [])
Expand Down

0 comments on commit 78e5245

Please sign in to comment.