mirror of
https://github.com/Mibew/handlebars.php.git
synced 2024-11-15 08:44:12 +03:00
More code style / indentation fixes
This commit is contained in:
parent
5257701669
commit
30f7afeb84
@ -88,7 +88,7 @@ class Helpers
|
||||
* @var $args array
|
||||
* @var $source string
|
||||
*/
|
||||
if ( is_numeric($args) ) {
|
||||
if (is_numeric($args)) {
|
||||
$tmp = $args;
|
||||
} else {
|
||||
$tmp = $context->get($args);
|
||||
|
@ -277,20 +277,20 @@ class Template
|
||||
$subexprs = array(); // will contain all subexpressions inside outermost brackets
|
||||
$lvl = 0;
|
||||
$cur_start = 0;
|
||||
for ( $i=0; $i < strlen($params[2]); $i++ ) {
|
||||
for ($i=0; $i < strlen($params[2]); $i++) {
|
||||
$cur = substr($params[2], $i, 1);
|
||||
if ( $cur == '(' ) {
|
||||
if ($cur == '(') {
|
||||
if( $lvl == 0 ) $cur_start = $i+1;
|
||||
$lvl++;
|
||||
}
|
||||
if ( $cur == ')' ) {
|
||||
if ($cur == ')') {
|
||||
$lvl--;
|
||||
if( $lvl == 0 ) $subexprs[] = substr($params[2], $cur_start, $i - $cur_start);
|
||||
if ($lvl == 0) $subexprs[] = substr($params[2], $cur_start, $i - $cur_start);
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $subexprs ) ) {
|
||||
foreach ( $subexprs as $expr ) {
|
||||
if (! empty($subexprs)) {
|
||||
foreach ($subexprs as $expr) {
|
||||
$cmd = explode(" ", $expr);
|
||||
$name = trim($cmd[0]);
|
||||
// construct artificial section node
|
||||
|
Loading…
Reference in New Issue
Block a user