Skip to content

Commit d4eaa17

Browse files
Merge pull request #19277 from SachinBahukhandi/twig-update-fix
Fixed the issue appearing on updating twig
2 parents ca2fb1b + da6847d commit d4eaa17

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Error/Error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public static function getArg(mixed $arg, string $function): string
396396
'_realConnect',
397397
];
398398

399-
if (in_array($function, $includeFunctions, true)) {
399+
if (in_array($function, $includeFunctions, true) && is_string($arg)) {
400400
$retval .= self::relPath($arg);
401401
} elseif (in_array($function, $connectFunctions, true) && is_string($arg)) {
402402
$retval .= gettype($arg) . ' ********';

src/Twig/Node/Expression/TransExpression.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PhpMyAdmin\Twig\Node\Expression;
66

7+
use Twig\Attribute\FirstClassTwigCallableReady;
78
use Twig\Compiler;
89
use Twig\Error\SyntaxError;
910
use Twig\Node\Expression\AbstractExpression;
@@ -18,6 +19,7 @@
1819

1920
final class TransExpression extends AbstractExpression
2021
{
22+
#[FirstClassTwigCallableReady]
2123
public function __construct(string $name, Node $arguments, int $lineno)
2224
{
2325
parent::__construct(['arguments' => $arguments], ['name' => $name, 'is_defined_test' => false], $lineno);

0 commit comments

Comments
 (0)