mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 20:18:52 +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:
@@ -24,8 +24,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
*/
|
||||
class TranslationsCacheWarmer implements CacheWarmerInterface, ServiceSubscriberInterface
|
||||
{
|
||||
private $container;
|
||||
private $translator;
|
||||
private ContainerInterface $container;
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(ContainerInterface $container)
|
||||
{
|
||||
@@ -34,35 +34,27 @@ class TranslationsCacheWarmer implements CacheWarmerInterface, ServiceSubscriber
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return string[]
|
||||
* @param string|null $buildDir
|
||||
*/
|
||||
public function warmUp(string $cacheDir)
|
||||
public function warmUp(string $cacheDir /* , string $buildDir = null */): array
|
||||
{
|
||||
if (null === $this->translator) {
|
||||
$this->translator = $this->container->get('translator');
|
||||
}
|
||||
$this->translator ??= $this->container->get('translator');
|
||||
|
||||
if ($this->translator instanceof WarmableInterface) {
|
||||
return (array) $this->translator->warmUp($cacheDir);
|
||||
$buildDir = 1 < \func_num_args() ? func_get_arg(1) : null;
|
||||
|
||||
return (array) $this->translator->warmUp($cacheDir, $buildDir);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isOptional()
|
||||
public function isOptional(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function getSubscribedServices()
|
||||
public static function getSubscribedServices(): array
|
||||
{
|
||||
return [
|
||||
'translator' => TranslatorInterface::class,
|
||||
|
||||
Reference in New Issue
Block a user