[Maintenance] Note deprecation in SelectAttributeChoicesCollectionType

This commit is contained in:
Jan Goralski 2023-08-18 08:39:26 +02:00
parent 61ffae5f9f
commit 9b930d73c3
No known key found for this signature in database
GPG key ID: 95D91BA380F31EDD
2 changed files with 9 additions and 0 deletions

View file

@ -131,3 +131,6 @@
Because of that, the subscribers `Sylius\Bundle\AttributeBundle\Doctrine\ORM\Subscriber\LoadMetadataSubscriber`
and `Sylius\Bundle\ReviewBundle\Doctrine\ORM\Subscriber\LoadMetadataSubscriber` have changed so that it does not add
a relationship if one already exists. If you have overwritten or decorated it, there may be a need to update it.
1. Passing an instance of `Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface` as the first argument
to `Sylius\Bundle\AttributeBundle\Form\Type\AttributeType\Configuration\SelectAttributeChoicesCollectionType` has been deprecated.

View file

@ -28,6 +28,12 @@ class SelectAttributeChoicesCollectionType extends AbstractType
public function __construct(?TranslationLocaleProviderInterface $localeProvider = null)
{
if (null !== $localeProvider) {
@trigger_error(sprintf(
'Passing an instance of %s as a constructor argument for %s is deprecated as of Sylius 1.13 and will not be possible in 2.0.',
TranslationLocaleProviderInterface::class,
self::class
), \E_USER_DEPRECATED);
$this->defaultLocaleCode = $localeProvider->getDefaultLocaleCode();
}
}