From: Fabien Potencier Date: Sat, 12 Jun 2010 13:43:21 +0000 (+0200) Subject: removed getName() method in Twig_Template X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=57f2853320feb7f9b82c4f9a0a7b85c2cbf4bb3d;p=web%2Fkonrad%2Ftwig.git removed getName() method in Twig_Template --- diff --git a/lib/Twig/Node/Module.php b/lib/Twig/Node/Module.php index 95b96e9..2f4f97d 100644 --- a/lib/Twig/Node/Module.php +++ b/lib/Twig/Node/Module.php @@ -50,8 +50,6 @@ class Twig_Node_Module extends Twig_Node $compiler->subcompile($this->blocks); - $this->compileGetName($compiler); - $this->compileMacros($compiler); $this->compileClassFooter($compiler); @@ -152,19 +150,6 @@ class Twig_Node_Module extends Twig_Node ; } - protected function compileGetName($compiler) - { - $compiler - ->write("public function getName()\n", "{\n") - ->indent() - ->write('return ') - ->string($this['filename']) - ->raw(";\n") - ->outdent() - ->write("}\n\n") - ; - } - protected function compileDisplayFooter($compiler) { $compiler diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index 4e486c1..17faea2 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -61,6 +61,4 @@ abstract class Twig_Template extends Twig_Resource implements Twig_TemplateInter return ob_get_clean(); } - - abstract protected function getName(); } diff --git a/test/Twig/Tests/Node/ModuleTest.php b/test/Twig/Tests/Node/ModuleTest.php index 3fea5d4..261c05b 100644 --- a/test/Twig/Tests/Node/ModuleTest.php +++ b/test/Twig/Tests/Node/ModuleTest.php @@ -40,7 +40,6 @@ class Twig_Tests_Node_ModuleTest extends Twig_Tests_Node_TestCase * @covers Twig_Node_Module::compileDisplayHeader * @covers Twig_Node_Module::compileDisplayBody * @covers Twig_Node_Module::compileDisplayFooter - * @covers Twig_Node_Module::compileGetName * @covers Twig_Node_Module::compileClassFooter * @dataProvider getTests */ @@ -73,11 +72,6 @@ class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template echo "foo"; } - public function getName() - { - return "foo.twig"; - } - } EOF , $twig); @@ -106,11 +100,6 @@ class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template \$this->parent->display(\$context); } - public function getName() - { - return "foo.twig"; - } - } EOF , $twig); @@ -144,11 +133,6 @@ class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template \$this->parent->display(\$context); } - public function getName() - { - return "foo.twig"; - } - } EOF , $twig); diff --git a/test/Twig/Tests/Node/SandboxedModuleTest.php b/test/Twig/Tests/Node/SandboxedModuleTest.php index 49217c5..2769aa9 100644 --- a/test/Twig/Tests/Node/SandboxedModuleTest.php +++ b/test/Twig/Tests/Node/SandboxedModuleTest.php @@ -78,11 +78,6 @@ class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template ); } - public function getName() - { - return "foo.twig"; - } - } EOF , $twig); @@ -122,11 +117,6 @@ class __TwigTemplate_be925a7b06dda0dfdbd18a1509f7eb34 extends Twig_Template \$this->parent->checkSecurity(); } - public function getName() - { - return "foo.twig"; - } - } EOF , $twig);