update patch 1
This commit is contained in:
@@ -21,15 +21,11 @@ use Symfony\Component\Translation\TranslatorBagInterface;
|
||||
*/
|
||||
class FilteringProvider implements ProviderInterface
|
||||
{
|
||||
private ProviderInterface $provider;
|
||||
private array $locales;
|
||||
private array $domains;
|
||||
|
||||
public function __construct(ProviderInterface $provider, array $locales, array $domains = [])
|
||||
{
|
||||
$this->provider = $provider;
|
||||
$this->locales = $locales;
|
||||
$this->domains = $domains;
|
||||
public function __construct(
|
||||
private ProviderInterface $provider,
|
||||
private array $locales,
|
||||
private array $domains = [],
|
||||
) {
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
|
||||
@@ -44,7 +44,7 @@ final class TranslationProviderCollection
|
||||
public function get(string $name): ProviderInterface
|
||||
{
|
||||
if (!$this->has($name)) {
|
||||
throw new InvalidArgumentException(sprintf('Provider "%s" not found. Available: "%s".', $name, (string) $this));
|
||||
throw new InvalidArgumentException(\sprintf('Provider "%s" not found. Available: "%s".', $name, (string) $this));
|
||||
}
|
||||
|
||||
return $this->providers[$name];
|
||||
|
||||
+4
-7
@@ -18,16 +18,13 @@ use Symfony\Component\Translation\Exception\UnsupportedSchemeException;
|
||||
*/
|
||||
class TranslationProviderCollectionFactory
|
||||
{
|
||||
private iterable $factories;
|
||||
private array $enabledLocales;
|
||||
|
||||
/**
|
||||
* @param iterable<mixed, ProviderFactoryInterface> $factories
|
||||
*/
|
||||
public function __construct(iterable $factories, array $enabledLocales)
|
||||
{
|
||||
$this->factories = $factories;
|
||||
$this->enabledLocales = $enabledLocales;
|
||||
public function __construct(
|
||||
private iterable $factories,
|
||||
private array $enabledLocales,
|
||||
) {
|
||||
}
|
||||
|
||||
public function fromConfig(array $config): TranslationProviderCollection
|
||||
|
||||
Reference in New Issue
Block a user