N°8834 - Add compatibility with PHP 8.4 (#819)

* N°8834 - Add compatibility with PHP 8.4

* Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
Lenaick
2026-02-26 10:36:32 +01:00
committed by GitHub
parent d4821b7edc
commit fc967c06ce
961 changed files with 12298 additions and 7130 deletions

View File

@@ -36,7 +36,7 @@ class TemplateIterator implements \IteratorAggregate
* @param string|null $defaultPath The directory where global templates can be stored
* @param string[] $namePatterns Pattern of file names
*/
public function __construct(KernelInterface $kernel, array $paths = [], string $defaultPath = null, array $namePatterns = [])
public function __construct(KernelInterface $kernel, array $paths = [], ?string $defaultPath = null, array $namePatterns = [])
{
$this->kernel = $kernel;
$this->paths = $paths;
@@ -64,6 +64,12 @@ class TemplateIterator implements \IteratorAggregate
if (null !== $this->defaultPath) {
$templates[] = $this->findTemplatesInDirectory($this->defaultPath.'/bundles/'.$bundle->getName(), $name);
}
/*
* The bundle's own templates are also registered with the "!" prefix namespace - this matches
* @see \Symfony\Bundle\TwigBundle\DependencyInjection\TwigExtension::load()
*/
$templates[] = $this->findTemplatesInDirectory($bundleTemplatesDir, '!'.$name);
}
foreach ($this->paths as $dir => $namespace) {
@@ -78,7 +84,7 @@ class TemplateIterator implements \IteratorAggregate
*
* @return string[]
*/
private function findTemplatesInDirectory(string $dir, string $namespace = null, array $excludeDirs = []): array
private function findTemplatesInDirectory(string $dir, ?string $namespace = null, array $excludeDirs = []): array
{
if (!is_dir($dir)) {
return [];