mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 10:56:38 +00:00
Remove deprecated code
This commit is contained in:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user