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