Remove deprecated code

This commit is contained in:
Fabien Potencier
2024-07-28 10:14:26 +02:00
parent 0298159c5f
commit c097774d99
2 changed files with 1 additions and 9 deletions
-3
View File
@@ -560,9 +560,6 @@ Twig supports the following optimizations:
* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_FOR``, optimizes the ``for`` tag by
removing the ``loop`` variable creation whenever possible.
* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_RAW_FILTER``, removes the ``raw``
filter whenever possible.
* ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_TEXT_NODES``, optimizes the text
nodes by merging consecutive text nodes into a single one.
+1 -6
View File
@@ -42,7 +42,6 @@ final class OptimizerNodeVisitor implements NodeVisitorInterface
public const OPTIMIZE_ALL = -1;
public const OPTIMIZE_NONE = 0;
public const OPTIMIZE_FOR = 2;
public const OPTIMIZE_RAW_FILTER = 4;
public const OPTIMIZE_TEXT_NODES = 8;
/**
@@ -60,14 +59,10 @@ final class OptimizerNodeVisitor implements NodeVisitorInterface
*/
public function __construct(int $optimizers = -1)
{
if ($optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_RAW_FILTER | self::OPTIMIZE_TEXT_NODES)) {
if ($optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_TEXT_NODES)) {
throw new \InvalidArgumentException(\sprintf('Optimizer mode "%s" is not valid.', $optimizers));
}
if (-1 !== $optimizers && self::OPTIMIZE_RAW_FILTER === (self::OPTIMIZE_RAW_FILTER & $optimizers)) {
trigger_deprecation('twig/twig', '3.11', 'The "Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_RAW_FILTER" option is deprecated and does nothing.');
}
$this->optimizers = $optimizers;
}