Remove usage of defaultLocaleCode from SelectAttributeChoicesCollectionType

This commit is contained in:
TheMilek 2023-08-10 10:04:24 +02:00
parent 163953bf8e
commit ec4d4d890f
No known key found for this signature in database
GPG key ID: 2E44205E7374692F
2 changed files with 0 additions and 13 deletions

View file

@ -14,7 +14,6 @@ declare(strict_types=1);
namespace Sylius\Bundle\AttributeBundle\Form\Type\AttributeType\Configuration;
use Ramsey\Uuid\Uuid;
use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\FormBuilderInterface;
@ -23,13 +22,6 @@ use Symfony\Component\Form\FormEvents;
class SelectAttributeChoicesCollectionType extends AbstractType
{
private string $defaultLocaleCode;
public function __construct(TranslationLocaleProviderInterface $localeProvider)
{
$this->defaultLocaleCode = $localeProvider->getDefaultLocaleCode();
}
/**
* @psalm-suppress InvalidScalarArgument Some weird magic going on here, not sure about refactor
*/
@ -48,10 +40,6 @@ class SelectAttributeChoicesCollectionType extends AbstractType
continue;
}
if (!array_key_exists($this->defaultLocaleCode, $values)) {
continue;
}
$key = (string) $key;
$newKey = $this->getUniqueKey();
$fixedData[$newKey] = $this->resolveValues($values);

View file

@ -65,7 +65,6 @@
</service>
<service id="sylius.form.type.attribute_type.select.choices_collection" class="Sylius\Bundle\AttributeBundle\Form\Type\AttributeType\Configuration\SelectAttributeChoicesCollectionType">
<argument id="sylius.translation_locale_provider" type="service"/>
<tag name="form.type" />
</service>