Remove the deprecation getters from TwigCallableInterface

This commit is contained in:
Fabien Potencier
2026-09-25 23:51:30 +02:00
parent dbfd06ffba
commit a5abf30b19
3 changed files with 1 additions and 21 deletions
+1
View File
@@ -7,6 +7,7 @@
* Add an optional `string $template = ''` argument to `IncludeNode::addGetTemplate()`; subclasses overriding this method must declare a compatible parameter
* Remove the obsolete `Twig\Test\NodeTestCase::getTests()` method; override `provideTests()` instead
* Make `Twig\Markup` final
* Remove `getDeprecatingPackage()`, `getDeprecatedVersion()`, and `getAlternative()` from `Twig\TwigCallableInterface` and `Twig\AbstractTwigCallable`; use `Twig\AbstractTwigCallable::triggerDeprecation()` instead
* Add native return types to the protected extension points in `Twig\Test\IntegrationTestCase` and `Twig\Test\NodeTestCase` and require overriding methods to declare compatible return types
* Remove `TemplateVariable` and `AssignTemplateVariable`; use `MacroVariable` and `AssignMacroVariable` instead
* Add the `isAlwaysAllowedInSandbox()` method to `Twig\TwigCallableInterface` and `Twig\TokenParser\TokenParserInterface`
-15
View File
@@ -140,21 +140,6 @@ abstract class AbstractTwigCallable implements TwigCallableInterface
$this->options['deprecation_info']->triggerDeprecation($file, $line);
}
public function getDeprecatingPackage(): string
{
throw new \LogicException('Not available anymore.');
}
public function getDeprecatedVersion(): string
{
throw new \LogicException('Not available anymore.');
}
public function getAlternative(): ?string
{
throw new \LogicException('Not available anymore.');
}
public function getMinimalNumberOfRequiredArguments(): int
{
return ($this->options['needs_charset'] ? 1 : 0) + ($this->options['needs_environment'] ? 1 : 0) + ($this->options['needs_context'] ? 1 : 0) + ($this->options['needs_is_sandboxed'] ? 1 : 0) + \count($this->arguments);
-6
View File
@@ -47,11 +47,5 @@ interface TwigCallableInterface extends \Stringable
public function isDeprecated(): bool;
public function getDeprecatingPackage(): string;
public function getDeprecatedVersion(): string;
public function getAlternative(): ?string;
public function getMinimalNumberOfRequiredArguments(): int;
}