Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Feb 15, 2024
1 parent 0990f81 commit b46e93c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Node/ModuleNode.php
Expand Up @@ -153,14 +153,14 @@ protected function compileClassHeader(Compiler $compiler)
->write("use Twig\Sandbox\SecurityNotAllowedFilterError;\n")
->write("use Twig\Sandbox\SecurityNotAllowedFunctionError;\n")
->write("use Twig\Source;\n")
->write(sprintf("use Twig\%s;\n\n", 'Template'))
->write("use Twig\Template;\n\n")
;
}
$compiler
// if the template name contains */, add a blank to avoid a PHP parse error
->write('/* '.str_replace('*/', '* /', $this->getSourceContext()->getName())." */\n")
->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getSourceContext()->getName(), $this->getAttribute('index')))
->raw(sprintf(" extends %s\n", 'Template'))
->raw(" extends Template\n")
->write("{\n")
->indent()
->write("private \$source;\n")
Expand Down
2 changes: 2 additions & 0 deletions src/Profiler/Node/EnterProfileNode.php
Expand Up @@ -11,6 +11,7 @@

namespace Twig\Profiler\Node;

use Twig\Attribute\YieldReady;
use Twig\Compiler;
use Twig\Node\Node;

Expand All @@ -19,6 +20,7 @@
*
* @author Fabien Potencier <fabien@symfony.com>
*/
#[YieldReady]
class EnterProfileNode extends Node
{
public function __construct(string $extensionName, string $type, string $name, string $varName)
Expand Down
2 changes: 2 additions & 0 deletions src/Profiler/Node/LeaveProfileNode.php
Expand Up @@ -11,6 +11,7 @@

namespace Twig\Profiler\Node;

use Twig\Attribute\YieldReady;
use Twig\Compiler;
use Twig\Node\Node;

Expand All @@ -19,6 +20,7 @@
*
* @author Fabien Potencier <fabien@symfony.com>
*/
#[YieldReady]
class LeaveProfileNode extends Node
{
public function __construct(string $varName)
Expand Down

0 comments on commit b46e93c

Please sign in to comment.