Merge branch 'origin/master'

Conflicts:
	CHANGELOG.md
This commit is contained in:
Ivan Shalganov
2014-01-08 01:10:18 +04:00
6 changed files with 59 additions and 19 deletions

View File

@@ -25,7 +25,7 @@ class Modifier
*/
public static function dateFormat($date, $format = "%b %e, %Y")
{
if (is_string($date) && !is_numeric($date)) {
if (!is_numeric($date)) {
$date = strtotime($date);
if (!$date) $date = time();
}
@@ -39,7 +39,7 @@ class Modifier
*/
public static function date($date, $format = "Y m d")
{
if (is_string($date) && !is_numeric($date)) {
if (!is_numeric($date)) {
$date = strtotime($date);
if (!$date) $date = time();
}
@@ -100,7 +100,7 @@ class Modifier
if (preg_match('#^(.{' . $length . '}).*?(.{' . $length . '})?$#usS', $string, $match)) {
if (count($match) == 3) {
if ($by_words) {
return preg_replace('#\s.*$#usS', "", $match[1]) . $etc . preg_replace('#^.*\s#usS', "", $match[2]);
return preg_replace('#\s.*$#usS', "", $match[1]) . $etc . preg_replace('#.*\s#usS', "", $match[2]);
} else {
return $match[1] . $etc . $match[2];
}

View File

@@ -732,7 +732,14 @@ class Template extends Render
if ($this->_options & Fenom::DENY_METHODS) {
throw new \LogicException("Forbidden to call methods");
}
$code .= $this->parseArgs($tokens);
do { // parse call-chunks: $var->func()->func()->prop->func()->...
if($tokens->is('(')) {
$code .= $this->parseArgs($tokens);
}
if($tokens->is(T_OBJECT_OPERATOR) && $tokens->isNext(T_STRING)) {
$code .= '->'.$tokens->next()->getAndNext();
}
} while($tokens->is('(', T_OBJECT_OPERATOR));
} elseif ($tokens->is(Tokenizer::MACRO_INCDEC)) {
$code .= $tokens->getAndNext();
} else {