Remove unused escape param from renderInternal

This commit is contained in:
Justin Hileman
2013-01-26 14:49:14 -08:00
parent 05e527fe21
commit cf76a4b8f9
3 changed files with 8 additions and 19 deletions
+5 -13
View File
@@ -126,17 +126,13 @@ class Mustache_Compiler
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = \'\', $escape = false)
public function renderInternal(Mustache_Context $context, $indent = \'\')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = \'\';
%s
if ($escape) {
return %s;
} else {
return $buffer;
}
return $buffer;
}
%s
}';
@@ -145,16 +141,12 @@ class Mustache_Compiler
class %s extends Mustache_Template
{
public function renderInternal(Mustache_Context $context, $indent = \'\', $escape = false)
public function renderInternal(Mustache_Context $context, $indent = \'\')
{
$buffer = \'\';
%s
if ($escape) {
return %s;
} else {
return $buffer;
}
return $buffer;
}
%s
}';
@@ -173,7 +165,7 @@ class Mustache_Compiler
$sections = implode("\n", $this->sections);
$klass = empty($this->sections) ? self::KLASS_NO_LAMBDAS : self::KLASS;
return sprintf($this->prepare($klass, 0, false), $name, $code, $this->getEscape('$buffer'), $sections);
return sprintf($this->prepare($klass, 0, false), $name, $code, $sections);
}
const SECTION_CALL = '
+3 -2
View File
@@ -67,13 +67,14 @@ abstract class Mustache_Template
*
* This is where the magic happens :)
*
* NOTE: This method is not part of the Mustache.php public API.
*
* @param Mustache_Context $context
* @param string $indent (default: '')
* @param bool $escape (default: false)
*
* @return string Rendered template
*/
abstract public function renderInternal(Mustache_Context $context, $indent = '', $escape = false);
abstract public function renderInternal(Mustache_Context $context, $indent = '');
/**
* Tests whether a value should be iterated over (e.g. in a section context).
-4
View File
@@ -33,13 +33,11 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
return array(
array('', array(), 'Banana', false, 'ISO-8859-1', array(
"\nclass Banana extends Mustache_Template",
'return htmlspecialchars($buffer, ENT_COMPAT, \'ISO-8859-1\');',
'return $buffer;',
)),
array('', array($this->createTextToken('TEXT')), 'Monkey', false, 'UTF-8', array(
"\nclass Monkey extends Mustache_Template",
'return htmlspecialchars($buffer, ENT_COMPAT, \'UTF-8\');',
'$buffer .= $indent . \'TEXT\';',
'return $buffer;',
)),
@@ -47,7 +45,6 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
array('', array($this->createTextToken('TEXT')), 'Monkey', true, 'ISO-8859-1', array(
"\nclass Monkey extends Mustache_Template",
'$buffer .= $indent . \'TEXT\';',
'return call_user_func($this->mustache->getEscape(), $buffer);',
'return $buffer;',
)),
@@ -77,7 +74,6 @@ class Mustache_Test_CompilerTest extends PHPUnit_Framework_TestCase
'$buffer .= htmlspecialchars($value, ENT_COMPAT, \'UTF-8\');',
'$value = $context->last();',
'$buffer .= \'\\\'bar\\\'\';',
'return htmlspecialchars($buffer, ENT_COMPAT, \'UTF-8\');',
'return $buffer;',
)
),