Remove deprecated code

This commit is contained in:
Fabien Potencier
2025-02-21 19:05:11 +01:00
parent bec890f02f
commit 728adb4c61
6 changed files with 0 additions and 50 deletions
@@ -22,7 +22,6 @@ use Twig\Node\Node;
*/
class BlockReferenceExpression extends AbstractExpression implements SupportDefinedTestInterface
{
use SupportDefinedTestDeprecationTrait;
use SupportDefinedTestTrait;
public function __construct(AbstractExpression $name, ?Node $template, int $lineno)
@@ -18,7 +18,6 @@ use Twig\TwigFunction;
class FunctionExpression extends CallExpression implements SupportDefinedTestInterface
{
use SupportDefinedTestDeprecationTrait;
use SupportDefinedTestTrait;
#[FirstClassTwigCallableReady]
@@ -19,7 +19,6 @@ use Twig\Template;
class GetAttrExpression extends AbstractExpression implements SupportDefinedTestInterface
{
use SupportDefinedTestDeprecationTrait;
use SupportDefinedTestTrait;
public function __construct(AbstractExpression $node, AbstractExpression $attribute, ArrayExpression|ContextVariable|null $arguments, string $type, int $lineno)
@@ -21,7 +21,6 @@ use Twig\Node\Expression\Variable\TemplateVariable;
*/
class MacroReferenceExpression extends AbstractExpression implements SupportDefinedTestInterface
{
use SupportDefinedTestDeprecationTrait;
use SupportDefinedTestTrait;
public function __construct(TemplateVariable $template, string $name, AbstractExpression $arguments, int $lineno)
@@ -1,44 +0,0 @@
<?php
/*
* This file is part of Twig.
*
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Twig\Node\Expression;
/**
* @internal
*
* To be removed in 4.0
*
* @author Fabien Potencier <fabien@symfony.com>
*/
trait SupportDefinedTestDeprecationTrait
{
public function getAttribute($name, $default = null)
{
if ('is_defined_test' === $name) {
trigger_deprecation('twig/twig', '3.21', 'The "is_defined_test" attribute is deprecated, call "isDefinedTestEnabled()" instead.');
return $this->isDefinedTestEnabled();
}
return parent::getAttribute($name, $default);
}
public function setAttribute(string $name, $value): void
{
if ('is_defined_test' === $name) {
trigger_deprecation('twig/twig', '3.21', 'The "is_defined_test" attribute is deprecated, call "enableDefinedTest()" instead.');
$this->definedTest = (bool) $value;
} else {
parent::setAttribute($name, $value);
}
}
}
@@ -13,13 +13,11 @@ namespace Twig\Node\Expression\Variable;
use Twig\Compiler;
use Twig\Node\Expression\AbstractExpression;
use Twig\Node\Expression\SupportDefinedTestDeprecationTrait;
use Twig\Node\Expression\SupportDefinedTestInterface;
use Twig\Node\Expression\SupportDefinedTestTrait;
class ContextVariable extends AbstractExpression implements SupportDefinedTestInterface
{
use SupportDefinedTestDeprecationTrait;
use SupportDefinedTestTrait;
private array $specialVars = [