mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-04 14:36:52 +00:00
Fix Spread operator support
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
namespace Twig\Node\Expression;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Node\Expression\Unary\SpreadUnary;
|
||||
use Twig\Node\Expression\Unary\StringCastUnary;
|
||||
use Twig\Node\Expression\Variable\ContextVariable;
|
||||
use Twig\Node\Expression\Variable\LocalVariable;
|
||||
@@ -90,7 +91,7 @@ class ArrayExpression extends AbstractExpression
|
||||
$key = $pair['key']->getAttribute('value');
|
||||
}
|
||||
|
||||
if ($nextIndex !== $key) {
|
||||
if ($nextIndex !== $key && !$pair['value'] instanceof SpreadUnary) {
|
||||
$compiler
|
||||
->subcompile($pair['key'])
|
||||
->raw(' => ')
|
||||
|
||||
Reference in New Issue
Block a user