mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 18:36:53 +00:00
minor #4325 Use a more precise return type in AbstractTwigCallable (stof)
This PR was merged into the 3.x branch.
Discussion
----------
Use a more precise return type in AbstractTwigCallable
This method is not expected to change the type of callable.
As using it is the only way to configure arguments for a Twig callable (there is no constructor argument for them), it avoids getting static analysis errors in `Extension::getFunctions()` when using it.
Commits
-------
ebbbaf7069 Use a more precise return type in AbstractTwigCallable
This commit is contained in:
@@ -104,6 +104,9 @@ abstract class AbstractTwigCallable implements TwigCallableInterface
|
||||
return $this->options['needs_context'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return static
|
||||
*/
|
||||
public function withDynamicArguments(string $name, string $dynamicName, array $arguments): self
|
||||
{
|
||||
$new = clone $this;
|
||||
|
||||
Reference in New Issue
Block a user