From f47a09538e4deb70da9a58bb48de2f2da0efe836 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Fri, 4 Apr 2014 20:07:50 +0000 Subject: [PATCH] php 5.2.x doesn't support closures, so added a private static funtion to be used from array_filter instead --- src/Mustache/Compiler.php | 9 ++++++--- vendor/spec | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index da634d3..f7091cc 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -410,9 +410,7 @@ class Mustache_Compiler { $block = ''; - $real_children = array_filter($children, function($ch) { - return $ch[Mustache_Tokenizer::TYPE] == Mustache_Tokenizer::T_PARENT_ARG; - }); + $real_children = array_filter($children, array(__CLASS__, 'return_only_parent_args')); $block = $this->walk($real_children, $level); @@ -423,6 +421,11 @@ class Mustache_Compiler ); } + private static function return_only_parent_args($child) + { + return $child[Mustache_Tokenizer::TYPE] == Mustache_Tokenizer::T_PARENT_ARG; + } + const VARIABLE = ' $value = $this->resolveValue($context->%s(%s), $context, $indent);%s $buffer .= %s%s; diff --git a/vendor/spec b/vendor/spec index bf6288e..7c3923d 160000 --- a/vendor/spec +++ b/vendor/spec @@ -1 +1 @@ -Subproject commit bf6288ed6bd0ce8ccea6f1dac070b3d779132c3b +Subproject commit 7c3923d0079a345136325f7d1895f5d98efa9701