Skip to content

Commit

Permalink
Remove unneeded code
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed May 4, 2024
1 parent 9936c61 commit 67d1162
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function __construct(LoaderInterface $loader, $options = [])
]);

$this->addExtension(new CoreExtension());
$this->addExtension(new EscaperExtension($this->getRuntime(EscaperRuntime::class), $options['autoescape']));
$this->addExtension(new EscaperExtension($options['autoescape']));
$this->addExtension(new OptimizerExtension($options['optimizations']));
}

Expand Down
15 changes: 3 additions & 12 deletions src/Extension/EscaperExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Twig\Extension;

use Twig\Environment;
use Twig\FileExtensionEscapingStrategy;
use Twig\Node\Expression\ConstantExpression;
use Twig\Node\Node;
Expand All @@ -22,18 +21,10 @@

final class EscaperExtension extends AbstractExtension
{
private $escaper;
private $defaultStrategy;

/**
* @param string|false|callable $defaultStrategy An escaping strategy
*
* @see setDefaultStrategy()
*/
public function __construct(EscaperRuntime $escaper, $defaultStrategy = 'html')
{
public function __construct(
private $defaultStrategy = 'html'
) {
$this->setDefaultStrategy($defaultStrategy);
$this->escaper = $escaper;
}

public function getTokenParsers(): array
Expand Down

0 comments on commit 67d1162

Please sign in to comment.