mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 14:28:53 +02:00
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:
@@ -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 [];
|
||||
|
||||
Reference in New Issue
Block a user