mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
[UserBundle] Deprecate pin related services and classes
This commit is contained in:
parent
b7c0a85f63
commit
76809c5621
3 changed files with 43 additions and 23 deletions
|
|
@ -517,4 +517,8 @@
|
|||
|
||||
1. The `sylius_user.resources.{name}.user.resetting.pin` configuration parameter is deprecated and will be removed in 2.0.
|
||||
The corresponding email `reset_password_pin` and `Sylius\Bundle\UserBundle\Controller\UserController::requestPasswordResetPinAction`
|
||||
method have been also deprecated and will be removed in 2.0.
|
||||
method have been also deprecated and will be removed in 2.0. The related class `Sylius\Component\User\Security\Generator\UniquePinGenerator`
|
||||
and services have been deprecated as well:
|
||||
|
||||
* `sylius.{user_type}_user.pin_generator.password_reset`
|
||||
* `sylius.{user_type}_user.pin_uniqueness_checker.password_reset`
|
||||
|
|
|
|||
|
|
@ -119,29 +119,37 @@ final class SyliusUserExtension extends AbstractResourceExtension
|
|||
),
|
||||
)->setPublic(true);
|
||||
|
||||
$container->setDefinition(
|
||||
sprintf('sylius.%s_user.pin_generator.password_reset', $userType),
|
||||
$this->createTokenGeneratorDefinition(
|
||||
UniquePinGenerator::class,
|
||||
[
|
||||
new Reference('sylius.random_generator'),
|
||||
new Reference(sprintf('sylius.%s_user.pin_uniqueness_checker.password_reset', $userType)),
|
||||
$config['resetting']['pin']['length'],
|
||||
],
|
||||
),
|
||||
)->setPublic(true);
|
||||
$container
|
||||
->setDefinition(
|
||||
sprintf('sylius.%s_user.pin_generator.password_reset', $userType),
|
||||
$this->createTokenGeneratorDefinition(
|
||||
UniquePinGenerator::class,
|
||||
[
|
||||
new Reference('sylius.random_generator'),
|
||||
new Reference(sprintf('sylius.%s_user.pin_uniqueness_checker.password_reset', $userType)),
|
||||
$config['resetting']['pin']['length'],
|
||||
],
|
||||
),
|
||||
)
|
||||
->setPublic(true)
|
||||
->setDeprecated('sylius/user-bundle', '1.14', 'The "%service_id%" is deprecated and will be removed in Sylius 2.0.')
|
||||
;
|
||||
|
||||
$container->setDefinition(
|
||||
sprintf('sylius.%s_user.token_generator.email_verification', $userType),
|
||||
$this->createTokenGeneratorDefinition(
|
||||
UniqueTokenGenerator::class,
|
||||
[
|
||||
new Reference('sylius.random_generator'),
|
||||
new Reference(sprintf('sylius.%s_user.token_uniqueness_checker.email_verification', $userType)),
|
||||
$config['verification']['token']['length'],
|
||||
],
|
||||
),
|
||||
)->setPublic(true);
|
||||
$container
|
||||
->setDefinition(
|
||||
sprintf('sylius.%s_user.token_generator.email_verification', $userType),
|
||||
$this->createTokenGeneratorDefinition(
|
||||
UniqueTokenGenerator::class,
|
||||
[
|
||||
new Reference('sylius.random_generator'),
|
||||
new Reference(sprintf('sylius.%s_user.token_uniqueness_checker.email_verification', $userType)),
|
||||
$config['verification']['token']['length'],
|
||||
],
|
||||
),
|
||||
)
|
||||
->setPublic(true)
|
||||
->setDeprecated('sylius/user-bundle', '1.14', 'The "%service_id%" is deprecated and will be removed in Sylius 2.0.')
|
||||
;
|
||||
}
|
||||
|
||||
private function createTokenGeneratorDefinition(string $generatorClass, array $arguments): Definition
|
||||
|
|
|
|||
|
|
@ -17,6 +17,14 @@ use Sylius\Component\User\Security\Checker\UniquenessCheckerInterface;
|
|||
use Sylius\Resource\Generator\RandomnessGeneratorInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
trigger_deprecation(
|
||||
'sylius/user',
|
||||
'1.14',
|
||||
'The "%s" class is deprecated and will be removed in Sylius 2.0.',
|
||||
UniquePinGenerator::class,
|
||||
);
|
||||
|
||||
/** @deprecated since Sylius 1.14 and will be removed in Sylius 2.0. */
|
||||
final class UniquePinGenerator implements GeneratorInterface
|
||||
{
|
||||
private int $pinLength;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue