Fix tests and CS

This commit is contained in:
Fabien Potencier
2023-11-21 14:57:52 +01:00
parent 9f42a76306
commit 4be326aeeb
2 changed files with 33 additions and 9 deletions
+9 -9
View File
@@ -355,9 +355,9 @@ final class ModuleNode extends Node
protected function compileGetTemplateName(Compiler $compiler) protected function compileGetTemplateName(Compiler $compiler)
{ {
$compiler $compiler
->write("/**") ->write("/**\n")
->write(" * @codeCoverageIgnore") ->write(" * @codeCoverageIgnore\n")
->write(" */") ->write(" */\n")
->write("public function getTemplateName()\n", "{\n") ->write("public function getTemplateName()\n", "{\n")
->indent() ->indent()
->write('return ') ->write('return ')
@@ -412,9 +412,9 @@ final class ModuleNode extends Node
} }
$compiler $compiler
->write("/**") ->write("/**\n")
->write(" * @codeCoverageIgnore") ->write(" * @codeCoverageIgnore\n")
->write(" */") ->write(" */\n")
->write("public function isTraitable()\n", "{\n") ->write("public function isTraitable()\n", "{\n")
->indent() ->indent()
->write(sprintf("return %s;\n", $traitable ? 'true' : 'false')) ->write(sprintf("return %s;\n", $traitable ? 'true' : 'false'))
@@ -426,9 +426,9 @@ final class ModuleNode extends Node
protected function compileDebugInfo(Compiler $compiler) protected function compileDebugInfo(Compiler $compiler)
{ {
$compiler $compiler
->write("/**") ->write("/**\n")
->write(" * @codeCoverageIgnore") ->write(" * @codeCoverageIgnore\n")
->write(" */") ->write(" */\n")
->write("public function getDebugInfo()\n", "{\n") ->write("public function getDebugInfo()\n", "{\n")
->indent() ->indent()
->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true)))) ->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true))))
+24
View File
@@ -97,11 +97,17 @@ class __TwigTemplate_%x extends Template
echo "foo"; echo "foo";
} }
/**
* @codeCoverageIgnore
*/
public function getTemplateName() public function getTemplateName()
{ {
return "foo.twig"; return "foo.twig";
} }
/**
* @codeCoverageIgnore
*/
public function getDebugInfo() public function getDebugInfo()
{ {
return array ( 37 => 1,); return array ( 37 => 1,);
@@ -168,16 +174,25 @@ class __TwigTemplate_%x extends Template
\$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks)); \$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks));
} }
/**
* @codeCoverageIgnore
*/
public function getTemplateName() public function getTemplateName()
{ {
return "foo.twig"; return "foo.twig";
} }
/**
* @codeCoverageIgnore
*/
public function isTraitable() public function isTraitable()
{ {
return false; return false;
} }
/**
* @codeCoverageIgnore
*/
public function getDebugInfo() public function getDebugInfo()
{ {
return array ( 43 => 1, 41 => 2, 34 => 1,); return array ( 43 => 1, 41 => 2, 34 => 1,);
@@ -248,16 +263,25 @@ class __TwigTemplate_%x extends Template
\$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks)); \$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks));
} }
/**
* @codeCoverageIgnore
*/
public function getTemplateName() public function getTemplateName()
{ {
return "foo.twig"; return "foo.twig";
} }
/**
* @codeCoverageIgnore
*/
public function isTraitable() public function isTraitable()
{ {
return false; return false;
} }
/**
* @codeCoverageIgnore
*/
public function getDebugInfo() public function getDebugInfo()
{ {
return array ( 43 => 2, 41 => 4, 34 => 2,); return array ( 43 => 2, 41 => 4, 34 => 2,);