mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 20:36:33 +00:00
Merge branch '1.x'
* 1.x: deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext()
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
* 1.27.0 (2016-XX-XX)
|
||||
|
||||
* deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext()
|
||||
* deprecated Twig_Node::getFilename() in favor of Twig_Node::getName()
|
||||
* deprecated the "filename" escaping strategy (use "name" instead)
|
||||
* added Twig_Source to hold information about the original template
|
||||
|
||||
@@ -413,8 +413,10 @@ class Twig_Node_Module extends Twig_Node
|
||||
protected function compileGetSource(Twig_Compiler $compiler)
|
||||
{
|
||||
$compiler
|
||||
->write("/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */\n")
|
||||
->write("public function getSource()\n", "{\n")
|
||||
->indent()
|
||||
->write("@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);\n\n")
|
||||
->write('return ')
|
||||
->string($compiler->getEnvironment()->isDebug() ? $this->source->getCode() : '')
|
||||
->raw(";\n")
|
||||
|
||||
@@ -55,13 +55,6 @@ abstract class Twig_Template
|
||||
*/
|
||||
abstract public function getDebugInfo();
|
||||
|
||||
/**
|
||||
* Returns the template source code.
|
||||
*
|
||||
* @return string The template source code
|
||||
*/
|
||||
abstract public function getSource();
|
||||
|
||||
/**
|
||||
* Returns information about the original template source code.
|
||||
*
|
||||
|
||||
@@ -74,8 +74,11 @@ class __TwigTemplate_%x extends Twig_Template
|
||||
return array ( 19 => 1,);
|
||||
}
|
||||
|
||||
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
|
||||
public function getSource()
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -137,8 +140,11 @@ class __TwigTemplate_%x extends Twig_Template
|
||||
return array ( 26 => 1, 24 => 2, 11 => 1,);
|
||||
}
|
||||
|
||||
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
|
||||
public function getSource()
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -196,8 +202,11 @@ class __TwigTemplate_%x extends Twig_Template
|
||||
return array ( 17 => 2, 15 => 4, 9 => 2,);
|
||||
}
|
||||
|
||||
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
|
||||
public function getSource()
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
|
||||
|
||||
return "{{ foo }}";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user