More code style / indentation fixes

This commit is contained in:
majortom731 2014-03-17 16:46:12 +01:00
parent 5257701669
commit 30f7afeb84
2 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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