No need for elseif with returns :)
/cc @keradus
This commit is contained in:
@@ -631,11 +631,13 @@ class Mustache_Compiler
|
|||||||
{
|
{
|
||||||
if ($id === '.') {
|
if ($id === '.') {
|
||||||
return 'last';
|
return 'last';
|
||||||
} elseif (strpos($id, '.') === false) {
|
|
||||||
return 'find';
|
|
||||||
} else {
|
|
||||||
return 'findDot';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strpos($id, '.') === false) {
|
||||||
|
return 'find';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'findDot';
|
||||||
}
|
}
|
||||||
|
|
||||||
const IS_CALLABLE = '!is_string(%s) && is_callable(%s)';
|
const IS_CALLABLE = '!is_string(%s) && is_callable(%s)';
|
||||||
|
|||||||
@@ -181,9 +181,13 @@ class Mustache_Context
|
|||||||
// See https://github.com/bobthecow/mustache.php/wiki/Magic-Methods
|
// See https://github.com/bobthecow/mustache.php/wiki/Magic-Methods
|
||||||
if (method_exists($frame, $id)) {
|
if (method_exists($frame, $id)) {
|
||||||
return $frame->$id();
|
return $frame->$id();
|
||||||
} elseif (isset($frame->$id)) {
|
}
|
||||||
|
|
||||||
|
if (isset($frame->$id)) {
|
||||||
return $frame->$id;
|
return $frame->$id;
|
||||||
} elseif ($frame instanceof ArrayAccess && isset($frame[$id])) {
|
}
|
||||||
|
|
||||||
|
if ($frame instanceof ArrayAccess && isset($frame[$id])) {
|
||||||
return $frame[$id];
|
return $frame[$id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user