diff --git a/CHANGELOG b/CHANGELOG index dd746a90b..8eb9dc4ec 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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` diff --git a/src/AbstractTwigCallable.php b/src/AbstractTwigCallable.php index ae04a7ceb..0a06cf84f 100644 --- a/src/AbstractTwigCallable.php +++ b/src/AbstractTwigCallable.php @@ -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); diff --git a/src/TwigCallableInterface.php b/src/TwigCallableInterface.php index e1dd92bab..b712e205e 100644 --- a/src/TwigCallableInterface.php +++ b/src/TwigCallableInterface.php @@ -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; }