remove unneeded string cast

This commit is contained in:
Tobias Schultze
2013-09-04 01:07:08 +02:00
committed by Fabien Potencier
parent 6cbbe7cc4a
commit 5eff1b16ba
+1 -5
View File
@@ -116,8 +116,6 @@ abstract class Twig_Template implements Twig_TemplateInterface
*/
public function displayParentBlock($name, array $context, array $blocks = array())
{
$name = (string) $name;
if (isset($this->traits[$name])) {
$this->traits[$name][0]->displayBlock($name, $context, $blocks, false);
} elseif (false !== $parent = $this->getParent($context)) {
@@ -140,8 +138,6 @@ abstract class Twig_Template implements Twig_TemplateInterface
*/
public function displayBlock($name, array $context, array $blocks = array(), $useBlocks = true)
{
$name = (string) $name;
if ($useBlocks && isset($blocks[$name])) {
$template = $blocks[$name][0];
$block = $blocks[$name][1];
@@ -226,7 +222,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
*/
public function hasBlock($name)
{
return isset($this->blocks[(string) $name]);
return isset($this->blocks[$name]);
}
/**