fix:修复BUG/升级1.1.6版本

This commit is contained in:
Ying
2023-04-25 20:11:49 +08:00
parent 445e5f9662
commit 6a6866bbaf
2357 changed files with 456920 additions and 140567 deletions

View File

@@ -1,6 +1,13 @@
CHANGELOG
=========
5.4.21
------
* [BC BREAK] The following data providers for `ProviderFactoryTestCase` are now static:
`supportsProvider()`, `createProvider()`, `unsupportedSchemeProvider()`and `incompleteDsnProvider()`
* [BC BREAK] `ProviderTestCase::toStringProvider()` is now static
5.4
---

View File

@@ -16,6 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver;
/**
* @author Yonel Ceruto <yonelceruto@gmail.com>
@@ -136,28 +137,20 @@ class TranslatorPathsPass extends AbstractRecursivePass
private function findControllerArguments(ContainerBuilder $container): array
{
if ($container->hasDefinition($this->resolverServiceId)) {
$argument = $container->getDefinition($this->resolverServiceId)->getArgument(0);
if ($argument instanceof Reference) {
$argument = $container->getDefinition($argument);
}
if (!$container->has($this->resolverServiceId)) {
return [];
}
$resolverDef = $container->findDefinition($this->resolverServiceId);
return $argument->getArgument(0);
if (TraceableValueResolver::class === $resolverDef->getClass()) {
$resolverDef = $container->getDefinition($resolverDef->getArgument(0));
}
if ($container->hasDefinition('debug.'.$this->resolverServiceId)) {
$argument = $container->getDefinition('debug.'.$this->resolverServiceId)->getArgument(0);
if ($argument instanceof Reference) {
$argument = $container->getDefinition($argument);
}
$argument = $argument->getArgument(0);
if ($argument instanceof Reference) {
$argument = $container->getDefinition($argument);
}
return $argument->getArgument(0);
$argument = $resolverDef->getArgument(0);
if ($argument instanceof Reference) {
$argument = $container->getDefinition($argument);
}
return [];
return $argument->getArgument(0);
}
}

View File

@@ -1,4 +1,4 @@
Copyright (c) 2004-2022 Fabien Potencier
Copyright (c) 2004-present Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -71,7 +71,7 @@ class IcuResFileLoader implements LoaderInterface
*
* @param \ResourceBundle $rb The ResourceBundle that will be flattened
* @param array $messages Used internally for recursive calls
* @param string $path Current path being parsed, used internally for recursive calls
* @param string|null $path Current path being parsed, used internally for recursive calls
*
* @return array
*/

View File

@@ -41,7 +41,7 @@ interface MessageCatalogueInterface
*
* If $domain is null, it returns all messages.
*
* @param string $domain The domain name
* @param string|null $domain The domain name
*
* @return array
*/

View File

@@ -42,17 +42,17 @@ abstract class ProviderFactoryTestCase extends TestCase
/**
* @return iterable<array{0: bool, 1: string}>
*/
abstract public function supportsProvider(): iterable;
abstract public static function supportsProvider(): iterable;
/**
* @return iterable<array{0: string, 1: string, 2: TransportInterface}>
* @return iterable<array{0: string, 1: string}>
*/
abstract public function createProvider(): iterable;
abstract public static function createProvider(): iterable;
/**
* @return iterable<array{0: string, 1: string|null}>
*/
public function unsupportedSchemeProvider(): iterable
public static function unsupportedSchemeProvider(): iterable
{
return [];
}
@@ -60,7 +60,7 @@ abstract class ProviderFactoryTestCase extends TestCase
/**
* @return iterable<array{0: string, 1: string|null}>
*/
public function incompleteDsnProvider(): iterable
public static function incompleteDsnProvider(): iterable
{
return [];
}

View File

@@ -34,12 +34,12 @@ abstract class ProviderTestCase extends TestCase
protected $loader;
protected $xliffFileDumper;
abstract public function createProvider(HttpClientInterface $client, LoaderInterface $loader, LoggerInterface $logger, string $defaultLocale, string $endpoint): ProviderInterface;
abstract public static function createProvider(HttpClientInterface $client, LoaderInterface $loader, LoggerInterface $logger, string $defaultLocale, string $endpoint): ProviderInterface;
/**
* @return iterable<array{0: string, 1: ProviderInterface}>
* @return iterable<array{0: ProviderInterface, 1: string}>
*/
abstract public function toStringProvider(): iterable;
abstract public static function toStringProvider(): iterable;
/**
* @dataProvider toStringProvider

View File

@@ -70,7 +70,7 @@ final class TranslatorBag implements TranslatorBagInterface
$operation->moveMessagesToIntlDomainsIfPossible(AbstractOperation::NEW_BATCH);
$newCatalogue = new MessageCatalogue($locale);
foreach ($operation->getDomains() as $domain) {
foreach ($catalogue->getDomains() as $domain) {
$newCatalogue->add($operation->getNewMessages($domain), $domain);
}