Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:
curl https://fabbot.io/patch/twigphp/Twig/4398/2a8368fecfec3ecf5ec55e0712550b60f62b21e1/exception_messages.diff | patch -p0
diff -ru src/ExpressionParser.php src/ExpressionParser.php
--- src/ExpressionParser.php 2024-10-20 20:04:32.287199404 +0000
+++ src/ExpressionParser.php 2024-10-20 20:04:41.875543241 +0000
@@ -593,7 +593,7 @@
$arguments = $this->createArguments($lineno);
}
} else {
- throw new SyntaxError(\sprintf('Expected name or number, got value "%s" of type %s.', $token->getValue(), Token::typeToEnglish($token->getType())), $lineno, $stream->getSourceContext());
+ throw new SyntaxError(\sprintf('Expected name or number, got value "%s" of type "%s".', $token->getValue(), Token::typeToEnglish($token->getType())), $lineno, $stream->getSourceContext());
}
if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {