mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-08 08:26:46 +00:00
Add missing true for in_array
This commit is contained in:
@@ -22,13 +22,13 @@ final class LocalVariable extends AbstractExpression
|
||||
public function __construct(string|int|null $name, int $lineno)
|
||||
{
|
||||
// All names supported by ExpressionParser::parsePrimaryExpression() should be excluded
|
||||
if ($name && \in_array(strtolower($name), ['true', 'false', 'none', 'null'])) {
|
||||
if ($name && \in_array(strtolower($name), ['true', 'false', 'none', 'null'], true)) {
|
||||
throw new SyntaxError(\sprintf('You cannot assign a value to "%s".', $name), $lineno);
|
||||
}
|
||||
|
||||
if (null !== $name && (\is_int($name) || ctype_digit($name))) {
|
||||
$name = (int) $name;
|
||||
} elseif (\in_array($name, self::RESERVED_NAMES)) {
|
||||
} elseif (\in_array($name, self::RESERVED_NAMES, true)) {
|
||||
$name = "\u{035C}".$name;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ final class TemplateVariable extends AbstractExpression
|
||||
public function __construct(string|int|null $name, int $lineno)
|
||||
{
|
||||
// All names supported by ExpressionParser::parsePrimaryExpression() should be excluded
|
||||
if ($name && \in_array(strtolower($name), ['true', 'false', 'none', 'null'])) {
|
||||
if ($name && \in_array(strtolower($name), ['true', 'false', 'none', 'null'], true)) {
|
||||
throw new SyntaxError(\sprintf('You cannot assign a value to "%s".', $name), $lineno);
|
||||
}
|
||||
|
||||
if (null !== $name && (\is_int($name) || ctype_digit($name))) {
|
||||
$name = (int) $name;
|
||||
} elseif (\in_array($name, self::RESERVED_NAMES)) {
|
||||
} elseif (\in_array($name, self::RESERVED_NAMES, true)) {
|
||||
$name = "\u{035C}".$name;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user