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:
Fabien Potencier
2024-09-19 23:10:44 +02:00
+3
View File
@@ -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;