[Web] Update composer libs
- Removing symfony/deprecation-contracts (v2.4.0) - Upgrading ddeboer/imap (1.12.1 => 1.13.1) - Upgrading directorytree/ldaprecord (v2.6.3 => v2.10.1) - Upgrading illuminate/contracts (v8.53.1 => v9.3.0) - Upgrading nesbot/carbon (2.51.1 => 2.57.0) - Upgrading phpmailer/phpmailer (v6.5.0 => v6.6.0) - Upgrading psr/container (1.1.1 => 2.0.2) - Upgrading psr/log (1.1.4 => 3.0.0) - Upgrading psr/simple-cache (1.0.1 => 2.0.0) - Upgrading robthree/twofactorauth (1.8.0 => 1.8.1) - Upgrading symfony/polyfill-ctype (v1.23.0 => v1.24.0) - Upgrading symfony/polyfill-mbstring (v1.23.1 => v1.24.0) - Upgrading symfony/polyfill-php80 (v1.23.1 => v1.24.0) - Upgrading symfony/translation (v5.3.4 => v6.0.5) - Upgrading symfony/translation-contracts (v2.4.0 => v3.0.0) - Upgrading symfony/var-dumper (v5.3.6 => v6.0.5) - Upgrading tightenco/collect (v8.34.0 => v8.83.2) - Upgrading twig/twig (v3.3.2 => v3.3.8)
This commit is contained in:
@@ -20,28 +20,15 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
*/
|
||||
class TranslationDumperPass implements CompilerPassInterface
|
||||
{
|
||||
private $writerServiceId;
|
||||
private $dumperTag;
|
||||
|
||||
public function __construct(string $writerServiceId = 'translation.writer', string $dumperTag = 'translation.dumper')
|
||||
{
|
||||
if (1 < \func_num_args()) {
|
||||
trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
|
||||
}
|
||||
|
||||
$this->writerServiceId = $writerServiceId;
|
||||
$this->dumperTag = $dumperTag;
|
||||
}
|
||||
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (!$container->hasDefinition($this->writerServiceId)) {
|
||||
if (!$container->hasDefinition('translation.writer')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$definition = $container->getDefinition($this->writerServiceId);
|
||||
$definition = $container->getDefinition('translation.writer');
|
||||
|
||||
foreach ($container->findTaggedServiceIds($this->dumperTag, true) as $id => $attributes) {
|
||||
foreach ($container->findTaggedServiceIds('translation.dumper', true) as $id => $attributes) {
|
||||
$definition->addMethodCall('addDumper', [$attributes[0]['alias'], new Reference($id)]);
|
||||
}
|
||||
}
|
||||
|
@@ -21,28 +21,15 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
*/
|
||||
class TranslationExtractorPass implements CompilerPassInterface
|
||||
{
|
||||
private $extractorServiceId;
|
||||
private $extractorTag;
|
||||
|
||||
public function __construct(string $extractorServiceId = 'translation.extractor', string $extractorTag = 'translation.extractor')
|
||||
{
|
||||
if (0 < \func_num_args()) {
|
||||
trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
|
||||
}
|
||||
|
||||
$this->extractorServiceId = $extractorServiceId;
|
||||
$this->extractorTag = $extractorTag;
|
||||
}
|
||||
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (!$container->hasDefinition($this->extractorServiceId)) {
|
||||
if (!$container->hasDefinition('translation.extractor')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$definition = $container->getDefinition($this->extractorServiceId);
|
||||
$definition = $container->getDefinition('translation.extractor');
|
||||
|
||||
foreach ($container->findTaggedServiceIds($this->extractorTag, true) as $id => $attributes) {
|
||||
foreach ($container->findTaggedServiceIds('translation.extractor', true) as $id => $attributes) {
|
||||
if (!isset($attributes[0]['alias'])) {
|
||||
throw new RuntimeException(sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id));
|
||||
}
|
||||
|
@@ -18,34 +18,15 @@ use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
class TranslatorPass implements CompilerPassInterface
|
||||
{
|
||||
private $translatorServiceId;
|
||||
private $readerServiceId;
|
||||
private $loaderTag;
|
||||
private $debugCommandServiceId;
|
||||
private $updateCommandServiceId;
|
||||
|
||||
public function __construct(string $translatorServiceId = 'translator.default', string $readerServiceId = 'translation.reader', string $loaderTag = 'translation.loader', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_update')
|
||||
{
|
||||
if (0 < \func_num_args()) {
|
||||
trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
|
||||
}
|
||||
|
||||
$this->translatorServiceId = $translatorServiceId;
|
||||
$this->readerServiceId = $readerServiceId;
|
||||
$this->loaderTag = $loaderTag;
|
||||
$this->debugCommandServiceId = $debugCommandServiceId;
|
||||
$this->updateCommandServiceId = $updateCommandServiceId;
|
||||
}
|
||||
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (!$container->hasDefinition($this->translatorServiceId)) {
|
||||
if (!$container->hasDefinition('translator.default')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$loaders = [];
|
||||
$loaderRefs = [];
|
||||
foreach ($container->findTaggedServiceIds($this->loaderTag, true) as $id => $attributes) {
|
||||
foreach ($container->findTaggedServiceIds('translation.loader', true) as $id => $attributes) {
|
||||
$loaderRefs[$id] = new Reference($id);
|
||||
$loaders[$id][] = $attributes[0]['alias'];
|
||||
if (isset($attributes[0]['legacy-alias'])) {
|
||||
@@ -53,8 +34,8 @@ class TranslatorPass implements CompilerPassInterface
|
||||
}
|
||||
}
|
||||
|
||||
if ($container->hasDefinition($this->readerServiceId)) {
|
||||
$definition = $container->getDefinition($this->readerServiceId);
|
||||
if ($container->hasDefinition('translation.reader')) {
|
||||
$definition = $container->getDefinition('translation.reader');
|
||||
foreach ($loaders as $id => $formats) {
|
||||
foreach ($formats as $format) {
|
||||
$definition->addMethodCall('addLoader', [$format, $loaderRefs[$id]]);
|
||||
@@ -63,7 +44,7 @@ class TranslatorPass implements CompilerPassInterface
|
||||
}
|
||||
|
||||
$container
|
||||
->findDefinition($this->translatorServiceId)
|
||||
->findDefinition('translator.default')
|
||||
->replaceArgument(0, ServiceLocatorTagPass::register($container, $loaderRefs))
|
||||
->replaceArgument(3, $loaders)
|
||||
;
|
||||
@@ -73,16 +54,16 @@ class TranslatorPass implements CompilerPassInterface
|
||||
}
|
||||
|
||||
$paths = array_keys($container->getDefinition('twig.template_iterator')->getArgument(1));
|
||||
if ($container->hasDefinition($this->debugCommandServiceId)) {
|
||||
$definition = $container->getDefinition($this->debugCommandServiceId);
|
||||
if ($container->hasDefinition('console.command.translation_debug')) {
|
||||
$definition = $container->getDefinition('console.command.translation_debug');
|
||||
$definition->replaceArgument(4, $container->getParameter('twig.default_path'));
|
||||
|
||||
if (\count($definition->getArguments()) > 6) {
|
||||
$definition->replaceArgument(6, $paths);
|
||||
}
|
||||
}
|
||||
if ($container->hasDefinition($this->updateCommandServiceId)) {
|
||||
$definition = $container->getDefinition($this->updateCommandServiceId);
|
||||
if ($container->hasDefinition('console.command.translation_extract')) {
|
||||
$definition = $container->getDefinition('console.command.translation_extract');
|
||||
$definition->replaceArgument(5, $container->getParameter('twig.default_path'));
|
||||
|
||||
if (\count($definition->getArguments()) > 7) {
|
||||
|
@@ -22,30 +22,26 @@ use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
*/
|
||||
class TranslatorPathsPass extends AbstractRecursivePass
|
||||
{
|
||||
private $translatorServiceId;
|
||||
private $debugCommandServiceId;
|
||||
private $updateCommandServiceId;
|
||||
private $resolverServiceId;
|
||||
private $level = 0;
|
||||
private $paths = [];
|
||||
private $definitions = [];
|
||||
private $controllers = [];
|
||||
private int $level = 0;
|
||||
|
||||
public function __construct(string $translatorServiceId = 'translator', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_update', string $resolverServiceId = 'argument_resolver.service')
|
||||
{
|
||||
if (0 < \func_num_args()) {
|
||||
trigger_deprecation('symfony/translation', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
|
||||
}
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private array $paths = [];
|
||||
|
||||
$this->translatorServiceId = $translatorServiceId;
|
||||
$this->debugCommandServiceId = $debugCommandServiceId;
|
||||
$this->updateCommandServiceId = $updateCommandServiceId;
|
||||
$this->resolverServiceId = $resolverServiceId;
|
||||
}
|
||||
/**
|
||||
* @var array<int, Definition>
|
||||
*/
|
||||
private array $definitions = [];
|
||||
|
||||
/**
|
||||
* @var array<string, array<string, bool>>
|
||||
*/
|
||||
private array $controllers = [];
|
||||
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (!$container->hasDefinition($this->translatorServiceId)) {
|
||||
if (!$container->hasDefinition('translator')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,12 +66,12 @@ class TranslatorPathsPass extends AbstractRecursivePass
|
||||
}
|
||||
}
|
||||
if ($paths) {
|
||||
if ($container->hasDefinition($this->debugCommandServiceId)) {
|
||||
$definition = $container->getDefinition($this->debugCommandServiceId);
|
||||
if ($container->hasDefinition('console.command.translation_debug')) {
|
||||
$definition = $container->getDefinition('console.command.translation_debug');
|
||||
$definition->replaceArgument(6, array_merge($definition->getArgument(6), $paths));
|
||||
}
|
||||
if ($container->hasDefinition($this->updateCommandServiceId)) {
|
||||
$definition = $container->getDefinition($this->updateCommandServiceId);
|
||||
if ($container->hasDefinition('console.command.translation_extract')) {
|
||||
$definition = $container->getDefinition('console.command.translation_extract');
|
||||
$definition->replaceArgument(7, array_merge($definition->getArgument(7), $paths));
|
||||
}
|
||||
}
|
||||
@@ -86,10 +82,10 @@ class TranslatorPathsPass extends AbstractRecursivePass
|
||||
}
|
||||
}
|
||||
|
||||
protected function processValue($value, bool $isRoot = false)
|
||||
protected function processValue(mixed $value, bool $isRoot = false): mixed
|
||||
{
|
||||
if ($value instanceof Reference) {
|
||||
if ((string) $value === $this->translatorServiceId) {
|
||||
if ('translator' === (string) $value) {
|
||||
for ($i = $this->level - 1; $i >= 0; --$i) {
|
||||
$class = $this->definitions[$i]->getClass();
|
||||
|
||||
@@ -124,8 +120,8 @@ class TranslatorPathsPass extends AbstractRecursivePass
|
||||
|
||||
private function findControllerArguments(ContainerBuilder $container): array
|
||||
{
|
||||
if ($container->hasDefinition($this->resolverServiceId)) {
|
||||
$argument = $container->getDefinition($this->resolverServiceId)->getArgument(0);
|
||||
if ($container->hasDefinition('argument_resolver.service')) {
|
||||
$argument = $container->getDefinition('argument_resolver.service')->getArgument(0);
|
||||
if ($argument instanceof Reference) {
|
||||
$argument = $container->getDefinition($argument);
|
||||
}
|
||||
@@ -133,8 +129,8 @@ class TranslatorPathsPass extends AbstractRecursivePass
|
||||
return $argument->getArgument(0);
|
||||
}
|
||||
|
||||
if ($container->hasDefinition('debug.'.$this->resolverServiceId)) {
|
||||
$argument = $container->getDefinition('debug.'.$this->resolverServiceId)->getArgument(0);
|
||||
if ($container->hasDefinition('debug.'.'argument_resolver.service')) {
|
||||
$argument = $container->getDefinition('debug.'.'argument_resolver.service')->getArgument(0);
|
||||
if ($argument instanceof Reference) {
|
||||
$argument = $container->getDefinition($argument);
|
||||
}
|
||||
|
Reference in New Issue
Block a user