mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 10:26:32 +00:00
deprecated Twig_Compiler::addIndentation()
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
* 1.27.0 (2016-XX-XX)
|
||||
|
||||
* deprecated Twig_Compiler::addIndentation()
|
||||
* fixed regression when registering two extensions having the same class name
|
||||
* deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead)
|
||||
* fixed the filesystem loader with relative paths
|
||||
|
||||
@@ -148,6 +148,9 @@ Compiler
|
||||
* As of Twig 1.26, the ``Twig_Compiler::getFilename()`` has been deprecated.
|
||||
You should not use it anyway as its values is not reliable.
|
||||
|
||||
* As of Twig 1.27, the ``Twig_Compiler::addIndentation()`` has been deprecated.
|
||||
Use ``Twig_Compiler::write('')`` instead.
|
||||
|
||||
Loaders
|
||||
-------
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
||||
public function subcompile(Twig_NodeInterface $node, $raw = true)
|
||||
{
|
||||
if (false === $raw) {
|
||||
$this->addIndentation();
|
||||
$this->source .= str_repeat(' ', $this->indentation * 4);
|
||||
}
|
||||
|
||||
$node->compile($this);
|
||||
@@ -128,8 +128,7 @@ class Twig_Compiler implements Twig_CompilerInterface
|
||||
{
|
||||
$strings = func_get_args();
|
||||
foreach ($strings as $string) {
|
||||
$this->addIndentation();
|
||||
$this->source .= $string;
|
||||
$this->source .= str_repeat(' ', $this->indentation * 4).$string;
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -139,9 +138,13 @@ class Twig_Compiler implements Twig_CompilerInterface
|
||||
* Appends an indentation to the current PHP code after compilation.
|
||||
*
|
||||
* @return Twig_Compiler The current compiler instance
|
||||
*
|
||||
* @deprecated since 1.27 (to be removed in 2.0).
|
||||
*/
|
||||
public function addIndentation()
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use write(\'\') instead.', E_USER_DEPRECATED);
|
||||
|
||||
$this->source .= str_repeat(' ', $this->indentation * 4);
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -70,7 +70,7 @@ class Twig_Node_Macro extends Twig_Node
|
||||
|
||||
foreach ($this->getNode('arguments') as $name => $default) {
|
||||
$compiler
|
||||
->addIndentation()
|
||||
->write('')
|
||||
->string($name)
|
||||
->raw(' => $__'.$name.'__')
|
||||
->raw(",\n")
|
||||
@@ -78,7 +78,7 @@ class Twig_Node_Macro extends Twig_Node
|
||||
}
|
||||
|
||||
$compiler
|
||||
->addIndentation()
|
||||
->write('')
|
||||
->string(self::VARARGS_NAME)
|
||||
->raw(' => ')
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user