mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
fix indent of switch
This commit is contained in:
parent
d1856a4ed3
commit
287a8da70c
@ -70,31 +70,31 @@ class Parser
|
||||
continue;
|
||||
} else {
|
||||
switch ($token[Tokenizer::TYPE]) {
|
||||
case Tokenizer::T_END_SECTION:
|
||||
$newNodes = array();
|
||||
do {
|
||||
$result = array_pop($stack);
|
||||
if ($result === null) {
|
||||
throw new \LogicException(
|
||||
'Unexpected closing tag: /' . $token[Tokenizer::NAME]
|
||||
);
|
||||
}
|
||||
case Tokenizer::T_END_SECTION:
|
||||
$newNodes = array();
|
||||
do {
|
||||
$result = array_pop($stack);
|
||||
if ($result === null) {
|
||||
throw new \LogicException(
|
||||
'Unexpected closing tag: /' . $token[Tokenizer::NAME]
|
||||
);
|
||||
}
|
||||
|
||||
if (!array_key_exists(Tokenizer::NODES, $result)
|
||||
&& isset($result[Tokenizer::NAME])
|
||||
&& $result[Tokenizer::NAME] == $token[Tokenizer::NAME]
|
||||
) {
|
||||
$result[Tokenizer::NODES] = $newNodes;
|
||||
$result[Tokenizer::END] = $token[Tokenizer::INDEX];
|
||||
array_push($stack, $result);
|
||||
break 2;
|
||||
} else {
|
||||
array_unshift($newNodes, $result);
|
||||
}
|
||||
} while (true);
|
||||
break;
|
||||
default:
|
||||
array_push($stack, $token);
|
||||
if (!array_key_exists(Tokenizer::NODES, $result)
|
||||
&& isset($result[Tokenizer::NAME])
|
||||
&& $result[Tokenizer::NAME] == $token[Tokenizer::NAME]
|
||||
) {
|
||||
$result[Tokenizer::NODES] = $newNodes;
|
||||
$result[Tokenizer::END] = $token[Tokenizer::INDEX];
|
||||
array_push($stack, $result);
|
||||
break 2;
|
||||
} else {
|
||||
array_unshift($newNodes, $result);
|
||||
}
|
||||
} while (true);
|
||||
break;
|
||||
default:
|
||||
array_push($stack, $token);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user