Skip to content

Commit

Permalink
NGSTACK-857: support for Twig 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
pspanja committed Apr 24, 2024
1 parent 655bbc9 commit 3eb359e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions bundle/Templating/Twig/Node/GetAttrExpressionDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
use Traversable;
use Twig\Compiler;
use Twig\Environment;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Node\Expression\GetAttrExpression;
use Twig\Node\Node;
use Twig\Source;
use Twig\Template;

use function twig_get_attribute;

final class GetAttrExpressionDecorator extends GetAttrExpression
{
/** @noinspection MagicMethodsValidityInspection */
Expand Down Expand Up @@ -58,7 +57,7 @@ public function compile(Compiler $compiler): void
return;
}

$compiler->raw(self::class . '::twig_get_attribute($this->env, $this->source, ');
$compiler->raw(self::class . '::twigGetAttribute($this->env, $this->source, ');

if ($this->getAttribute('ignore_strict_check')) {
$this->getNode('node')->setAttribute('ignore_strict_check', true);
Expand Down Expand Up @@ -166,7 +165,7 @@ public function getSourceContext(): ?Source
* @param bool $sandboxed
* @param int $lineno
*/
public static function twig_get_attribute(
public static function twigGetAttribute(
Environment $env,
Source $source,
mixed $object,
Expand All @@ -179,7 +178,7 @@ public static function twig_get_attribute(
$lineno = -1,
) {
if (!$object instanceof Fields) {
return twig_get_attribute(
return CoreExtension::getAttribute(
$env,
$source,
$object,
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"ibexa/http-cache": "^4.6",
"ibexa/fieldtype-richtext": "^4.6",
"netgen/ibexa-search-extra": "^3.0",
"sensio/framework-extra-bundle": "^6.1.0"
"sensio/framework-extra-bundle": "^6.1.0",
"twig/twig": "^3.9"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
Expand Down

0 comments on commit 3eb359e

Please sign in to comment.