mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-09 13:25:41 +00:00
Remove the deprecation getters from TwigCallableInterface
This commit is contained in:
@@ -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`
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user