mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -38,7 +38,7 @@ class Translator extends BaseTranslator implements WarmableInterface
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $resourceLocales;
|
||||
private array $resourceLocales;
|
||||
|
||||
/**
|
||||
* Holds parameters from addResource() calls so we can defer the actual
|
||||
@@ -46,22 +46,22 @@ class Translator extends BaseTranslator implements WarmableInterface
|
||||
*
|
||||
* @var array[]
|
||||
*/
|
||||
private $resources = [];
|
||||
private array $resources = [];
|
||||
|
||||
/**
|
||||
* @var string[][]
|
||||
*/
|
||||
private $resourceFiles;
|
||||
private array $resourceFiles;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $scannedDirectories;
|
||||
private array $scannedDirectories;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $enabledLocales;
|
||||
private array $enabledLocales;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -95,11 +95,9 @@ class Translator extends BaseTranslator implements WarmableInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string[]
|
||||
* @param string|null $buildDir
|
||||
*/
|
||||
public function warmUp(string $cacheDir)
|
||||
public function warmUp(string $cacheDir /* , string $buildDir = null */): array
|
||||
{
|
||||
// skip warmUp when translator doesn't use cache
|
||||
if (null === $this->options['cache_dir']) {
|
||||
@@ -120,7 +118,7 @@ class Translator extends BaseTranslator implements WarmableInterface
|
||||
return [];
|
||||
}
|
||||
|
||||
public function addResource(string $format, $resource, string $locale, string $domain = null)
|
||||
public function addResource(string $format, mixed $resource, string $locale, string $domain = null): void
|
||||
{
|
||||
if ($this->resourceFiles) {
|
||||
$this->addResourceFiles();
|
||||
@@ -128,10 +126,7 @@ class Translator extends BaseTranslator implements WarmableInterface
|
||||
$this->resources[] = [$format, $resource, $locale, $domain];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function initializeCatalogue(string $locale)
|
||||
protected function initializeCatalogue(string $locale): void
|
||||
{
|
||||
$this->initialize();
|
||||
parent::initializeCatalogue($locale);
|
||||
@@ -150,6 +145,9 @@ class Translator extends BaseTranslator implements WarmableInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
if ($this->resourceFiles) {
|
||||
|
||||
Reference in New Issue
Block a user