mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 10:56:38 +00:00
minor #4486 Use [] instead of array() to represent a constant value in compiled code (fabpot)
This PR was merged into the 3.x branch.
Discussion
----------
Use [] instead of array() to represent a constant value in compiled code
Commits
-------
49f384f107 Use [] instead of array() to represent a constant value in compiled code
This commit is contained in:
+2
-2
@@ -170,7 +170,7 @@ class Compiler
|
||||
} elseif (\is_bool($value)) {
|
||||
$this->raw($value ? 'true' : 'false');
|
||||
} elseif (\is_array($value)) {
|
||||
$this->raw('array(');
|
||||
$this->raw('[');
|
||||
$first = true;
|
||||
foreach ($value as $key => $v) {
|
||||
if (!$first) {
|
||||
@@ -181,7 +181,7 @@ class Compiler
|
||||
$this->raw(' => ');
|
||||
$this->repr($v);
|
||||
}
|
||||
$this->raw(')');
|
||||
$this->raw(']');
|
||||
} else {
|
||||
$this->string($value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user