update patch 1

This commit is contained in:
fiqhpratama
2024-12-02 01:18:34 +07:00
parent 453d9bb470
commit 25026b0a85
3380 changed files with 103529 additions and 363623 deletions
+5 -9
View File
@@ -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];
@@ -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