Skip to content

Commit 1578060

Browse files
committed
Use the new dedicated AnonymousBlockElement class
1 parent f5bfd97 commit 1578060

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"require": {
2323
"php": ">=5.5.0",
2424
"phug/util": "^0.4.0",
25-
"phug/formatter": "^0.5.37",
25+
"phug/formatter": "^0.5.48",
2626
"phug/dependency-injection": "^1.1.2",
2727
"phug/parser": "^0.5.0"
2828
},

src/Phug/Compiler/NodeCompiler/BlockNodeCompiler.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Phug\Compiler\AbstractNodeCompiler;
66
use Phug\Compiler\Element\BlockElement;
7-
use Phug\Formatter\Element\ExpressionElement;
7+
use Phug\Formatter\Element\AnonymousBlockElement;
88
use Phug\Formatter\ElementInterface;
99
use Phug\Parser\Node\BlockNode;
1010
use Phug\Parser\Node\MixinNode;
@@ -24,11 +24,7 @@ protected function compileAnonymousBlock(BlockNode $node, ElementInterface $pare
2424
$node
2525
);
2626

27-
$expression = new ExpressionElement('$__pug_children(get_defined_vars())');
28-
$expression->uncheck();
29-
$expression->preventFromTransformation();
30-
31-
return $expression;
27+
return new AnonymousBlockElement();
3228
}
3329

3430
protected function hasBlockParent(BlockNode $node)

0 commit comments

Comments
 (0)