Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Sep 24, 2024
1 parent 12aa332 commit a0606de
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "LGPL-3.0-or-later",
"require": {
"php": "^7.4 || ^8.0",
"contao/core-bundle": "^4.9",
"contao/core-bundle": "^4.13",
"ext-json": "*",
"symfony/cache": "^4.4||^5.4",
"symfony/config": "^4.4||^5.4",
Expand Down
2 changes: 0 additions & 2 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ services:
HeimrichHannot\TwigSupportBundle\Cache\TemplateCache: ~
HeimrichHannot\TwigSupportBundle\Filesystem\TwigTemplateLocator:
public: true
bind:
$finderFactory: '@contao.twig.finder_factory'
HeimrichHannot\TwigSupportBundle\Helper\NormalizerHelper: ~
HeimrichHannot\TwigSupportBundle\Renderer\TwigTemplateRenderer:
public: true
Expand Down
14 changes: 1 addition & 13 deletions src/Filesystem/TwigTemplateLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,21 @@
use Contao\CoreBundle\Config\ResourceFinderInterface;
use Contao\CoreBundle\Framework\ContaoFramework;
use Contao\CoreBundle\Routing\ScopeMatcher;
use Contao\CoreBundle\Twig\Finder\FinderFactory;
use Contao\CoreBundle\Twig\Loader\TemplateLocator;
use Contao\PageModel;
use Contao\ThemeModel;
use Contao\Validator;
use HeimrichHannot\TwigSupportBundle\Cache\TemplateCache;
use HeimrichHannot\TwigSupportBundle\Exception\TemplateNotFoundException;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Filesystem\Path;
use Symfony\Component\Finder\Exception\DirectoryNotFoundException;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Stopwatch\Stopwatch;
use Twig\Environment;
use Webmozart\PathUtil\Path;

class TwigTemplateLocator
{
Expand All @@ -40,13 +38,8 @@ class TwigTemplateLocator
protected Stopwatch $stopwatch;
protected FilesystemAdapter $templateCache;
private ContaoFramework $contaoFramework;
private Environment $twig;
private FinderFactory $finderFactory;
private TemplateLocator $templateLocator;

/** @var array|string[] */
private array $resourcePaths;

public function __construct(
KernelInterface $kernel,
ResourceFinderInterface $contaoResourceFinder,
Expand All @@ -55,8 +48,6 @@ public function __construct(
Stopwatch $stopwatch,
FilesystemAdapter $templateCache,
ContaoFramework $contaoFramework,
Environment $twig,
FinderFactory $finderFactory,
TemplateLocator $templateLocator
)
{
Expand All @@ -67,8 +58,6 @@ public function __construct(
$this->stopwatch = $stopwatch;
$this->templateCache = $templateCache;
$this->contaoFramework = $contaoFramework;
$this->twig = $twig;
$this->finderFactory = $finderFactory;
$this->templateLocator = $templateLocator;
}

Expand Down Expand Up @@ -460,7 +449,6 @@ protected function generateContaoTwigTemplatePaths(bool $extension = false): arr
}

$twigFiles = [];
$projectDir = $this->kernel->getProjectDir();
foreach ($resourcePaths as $bundle => $paths) {
foreach ($paths as $path) {
$templates = $this->templateLocator->findTemplates($path);
Expand Down

0 comments on commit a0606de

Please sign in to comment.