Skip to content

Twig 3 deprecations #307

@acrobat

Description

@acrobat

This is the list of deprecations I get when building the cache on a project using

sylius/twig-extra      0.9.1  Additional Twig extensions for your Symfony projects
sylius/twig-hooks      0.9.1  Composable Twig layouts

  • Since twig/twig 3.21: Method "Twig\Parser::getExpressionParser()" is deprecated, use "parseExpression()" instead.
  • Since twig/twig 3.21: Class "Twig\ExpressionParser" is deprecated, use "Parser::parseExpression()" instead.
  • Since twig/twig 3.21: The "Twig\ExpressionParser::parseExpression()" method is deprecated, use "Parser::parseExpression()" instead
    These all relate to HookTokenParser.php Line 29

$hooksNames = $this->parser->getExpressionParser()->parseExpression();

  • Since twig/twig 3.21: The "Twig\ExpressionParser::parseMultitargetExpression()" method is deprecated.

$hookContext = $this->parser->getExpressionParser()->parseMultitargetExpression();

  • Since twig/twig 3.12: The "tag" constructor argument of the "Sylius\TwigHooks\Twig\Node\HookNode" class is deprecated and ignored (check which TokenParser class set it to "hook"), the tag is now automatically set by the Parser when needed.

parent::__construct(
[
'name' => $name,
'hook_level_context' => $context ?? new ArrayExpression([], $lineno),
],
[
'only' => $only,
],
$lineno,
$tag,
);

  • Since twig/twig 3.9: Twig node "Sylius\TwigHooks\Twig\Node\HookNode" is not marked as ready for using "yield" instead of "echo"; please make it ready and then flag it with the #[\Twig\Attribute\YieldReady] attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions