diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 11a80ac..ab2d872 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,7 @@ jobs: strategy: matrix: php: - - '8.0' + - '8.1' steps: - uses: actions/checkout@v2 diff --git a/composer.json b/composer.json index 2465bd2..447ee5e 100644 --- a/composer.json +++ b/composer.json @@ -67,8 +67,6 @@ "lolautruche/ez-core-extra-bundle": "<2.0" }, "config": { - "allow-plugins": { - "composer/package-versions-deprecated": true - } + "allow-plugins": false } } diff --git a/src/bundle/DependencyInjection/Compiler/TwigThemePass.php b/src/bundle/DependencyInjection/Compiler/TwigThemePass.php index ee5ce3b..7e5947c 100644 --- a/src/bundle/DependencyInjection/Compiler/TwigThemePass.php +++ b/src/bundle/DependencyInjection/Compiler/TwigThemePass.php @@ -13,7 +13,6 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Finder\Finder; /** @@ -29,10 +28,6 @@ public function process(ContainerBuilder $container) return; } - $globalViewsDir = $container->getParameter('twig.default_path'); - if (!is_dir($globalViewsDir)) { - (new Filesystem())->mkdir($globalViewsDir); - } $themesPathMap = [ '_override' => $container->getParameter('ibexa.design.templates.override_paths'), ]; @@ -54,11 +49,11 @@ public function process(ContainerBuilder $container) $twigLoaderDef = $container->findDefinition(TwigThemeLoader::class); // Now look for themes at application level - $appLevelThemesDir = $globalViewsDir . '/themes'; + $appLevelThemesDir = $container->getParameter('twig.default_path') . '/themes'; if (is_dir($appLevelThemesDir)) { foreach ((new Finder())->directories()->in($appLevelThemesDir)->depth('== 0') as $directoryInfo) { $theme = $directoryInfo->getBasename(); - $themePaths = isset($themesPathMap[$theme]) ? $themesPathMap[$theme] : []; + $themePaths = $themesPathMap[$theme] ?? []; // Application level paths are always top priority. array_unshift($themePaths, $directoryInfo->getRealPath()); $themesPathMap[$theme] = $themePaths;