mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Fixed some deprecations.
This commit is contained in:
parent
2a332b28a7
commit
193ecd252b
12 changed files with 66 additions and 24 deletions
|
@ -52,7 +52,7 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||||
|
|
||||||
class SetPasswordCommand extends Command
|
class SetPasswordCommand extends Command
|
||||||
{
|
{
|
||||||
|
@ -62,7 +62,7 @@ class SetPasswordCommand extends Command
|
||||||
protected $encoder;
|
protected $encoder;
|
||||||
protected $eventDispatcher;
|
protected $eventDispatcher;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $entityManager, UserPasswordEncoderInterface $passwordEncoder, EventDispatcherInterface $eventDispatcher)
|
public function __construct(EntityManagerInterface $entityManager, UserPasswordHasherInterface $passwordEncoder, EventDispatcherInterface $eventDispatcher)
|
||||||
{
|
{
|
||||||
$this->entityManager = $entityManager;
|
$this->entityManager = $entityManager;
|
||||||
$this->encoder = $passwordEncoder;
|
$this->encoder = $passwordEncoder;
|
||||||
|
@ -122,7 +122,7 @@ class SetPasswordCommand extends Command
|
||||||
}
|
}
|
||||||
|
|
||||||
//Encode password
|
//Encode password
|
||||||
$hash = $this->encoder->encodePassword($user, $new_password);
|
$hash = $this->encoder->hashPassword($user, $new_password);
|
||||||
$user->setPassword($hash);
|
$user->setPassword($hash);
|
||||||
|
|
||||||
//And save it to databae
|
//And save it to databae
|
||||||
|
|
|
@ -76,6 +76,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||||
use Symfony\Component\Validator\ConstraintViolationList;
|
use Symfony\Component\Validator\ConstraintViolationList;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
@ -106,7 +107,7 @@ abstract class BaseAdminController extends AbstractController
|
||||||
|
|
||||||
protected $entityManager;
|
protected $entityManager;
|
||||||
|
|
||||||
public function __construct(TranslatorInterface $translator, UserPasswordEncoderInterface $passwordEncoder,
|
public function __construct(TranslatorInterface $translator, UserPasswordHasherInterface $passwordEncoder,
|
||||||
AttachmentSubmitHandler $attachmentSubmitHandler,
|
AttachmentSubmitHandler $attachmentSubmitHandler,
|
||||||
EventCommentHelper $commentHelper, HistoryHelper $historyHelper, TimeTravel $timeTravel,
|
EventCommentHelper $commentHelper, HistoryHelper $historyHelper, TimeTravel $timeTravel,
|
||||||
DataTableFactory $dataTableFactory, EventDispatcherInterface $eventDispatcher, BarcodeExampleElementsGenerator $barcodeExampleGenerator,
|
DataTableFactory $dataTableFactory, EventDispatcherInterface $eventDispatcher, BarcodeExampleElementsGenerator $barcodeExampleGenerator,
|
||||||
|
|
|
@ -66,6 +66,7 @@ use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
@ -88,7 +89,7 @@ class CurrencyController extends BaseAdminController
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator,
|
||||||
UserPasswordEncoderInterface $passwordEncoder,
|
UserPasswordHasherInterface $passwordEncoder,
|
||||||
AttachmentSubmitHandler $attachmentSubmitHandler,
|
AttachmentSubmitHandler $attachmentSubmitHandler,
|
||||||
EventCommentHelper $commentHelper,
|
EventCommentHelper $commentHelper,
|
||||||
HistoryHelper $historyHelper,
|
HistoryHelper $historyHelper,
|
||||||
|
|
|
@ -82,7 +82,7 @@ class UserController extends AdminPages\BaseAdminController
|
||||||
{
|
{
|
||||||
//Check if we editing a user and if we need to change the password of it
|
//Check if we editing a user and if we need to change the password of it
|
||||||
if ($entity instanceof User && !empty($form['new_password']->getData())) {
|
if ($entity instanceof User && !empty($form['new_password']->getData())) {
|
||||||
$password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData());
|
$password = $this->passwordEncoder->hashPassword($entity, $form['new_password']->getData());
|
||||||
$entity->setPassword($password);
|
$entity->setPassword($password);
|
||||||
//By default the user must change the password afterwards
|
//By default the user must change the password afterwards
|
||||||
$entity->setNeedPwChange(true);
|
$entity->setNeedPwChange(true);
|
||||||
|
@ -134,7 +134,7 @@ class UserController extends AdminPages\BaseAdminController
|
||||||
protected function additionalActionNew(FormInterface $form, AbstractNamedDBElement $entity): bool
|
protected function additionalActionNew(FormInterface $form, AbstractNamedDBElement $entity): bool
|
||||||
{
|
{
|
||||||
if ($entity instanceof User && !empty($form['new_password']->getData())) {
|
if ($entity instanceof User && !empty($form['new_password']->getData())) {
|
||||||
$password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData());
|
$password = $this->passwordEncoder->hashPassword($entity, $form['new_password']->getData());
|
||||||
$entity->setPassword($password);
|
$entity->setPassword($password);
|
||||||
//By default the user must change the password afterwards
|
//By default the user must change the password afterwards
|
||||||
$entity->setNeedPwChange(true);
|
$entity->setNeedPwChange(true);
|
||||||
|
|
|
@ -61,6 +61,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||||
use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
|
use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
|
||||||
|
@ -199,7 +200,7 @@ class UserSettingsController extends AbstractController
|
||||||
*
|
*
|
||||||
* @return RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
* @return RedirectResponse|\Symfony\Component\HttpFoundation\Response
|
||||||
*/
|
*/
|
||||||
public function userSettings(Request $request, EntityManagerInterface $em, UserPasswordEncoderInterface $passwordEncoder, GoogleAuthenticator $googleAuthenticator, BackupCodeManager $backupCodeManager)
|
public function userSettings(Request $request, EntityManagerInterface $em, UserPasswordHasherInterface $passwordEncoder, GoogleAuthenticator $googleAuthenticator, BackupCodeManager $backupCodeManager)
|
||||||
{
|
{
|
||||||
/** @var User */
|
/** @var User */
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
@ -284,7 +285,7 @@ class UserSettingsController extends AbstractController
|
||||||
|
|
||||||
//Check if password if everything was correct, then save it to User and DB
|
//Check if password if everything was correct, then save it to User and DB
|
||||||
if (!$this->demo_mode && $pw_form->isSubmitted() && $pw_form->isValid()) {
|
if (!$this->demo_mode && $pw_form->isSubmitted() && $pw_form->isValid()) {
|
||||||
$password = $passwordEncoder->encodePassword($user, $pw_form['new_password']->getData());
|
$password = $passwordEncoder->hashPassword($user, $pw_form['new_password']->getData());
|
||||||
$user->setPassword($password);
|
$user->setPassword($password);
|
||||||
|
|
||||||
//After the change reset the password change needed setting
|
//After the change reset the password change needed setting
|
||||||
|
|
|
@ -46,6 +46,7 @@ use App\Entity\UserSystem\User;
|
||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||||
|
|
||||||
class UserFixtures extends Fixture
|
class UserFixtures extends Fixture
|
||||||
|
@ -53,7 +54,7 @@ class UserFixtures extends Fixture
|
||||||
protected $encoder;
|
protected $encoder;
|
||||||
protected $em;
|
protected $em;
|
||||||
|
|
||||||
public function __construct(UserPasswordEncoderInterface $encoder, EntityManagerInterface $entityManager)
|
public function __construct(UserPasswordHasherInterface $encoder, EntityManagerInterface $entityManager)
|
||||||
{
|
{
|
||||||
$this->em = $entityManager;
|
$this->em = $entityManager;
|
||||||
$this->encoder = $encoder;
|
$this->encoder = $encoder;
|
||||||
|
@ -65,12 +66,12 @@ class UserFixtures extends Fixture
|
||||||
$anonymous->setName('anonymous');
|
$anonymous->setName('anonymous');
|
||||||
$anonymous->setGroup($this->getReference(GroupFixtures::READONLY));
|
$anonymous->setGroup($this->getReference(GroupFixtures::READONLY));
|
||||||
$anonymous->setNeedPwChange(false);
|
$anonymous->setNeedPwChange(false);
|
||||||
$anonymous->setPassword($this->encoder->encodePassword($anonymous, 'test'));
|
$anonymous->setPassword($this->encoder->hashPassword($anonymous, 'test'));
|
||||||
$manager->persist($anonymous);
|
$manager->persist($anonymous);
|
||||||
|
|
||||||
$admin = new User();
|
$admin = new User();
|
||||||
$admin->setName('admin');
|
$admin->setName('admin');
|
||||||
$admin->setPassword($this->encoder->encodePassword($admin, 'test'));
|
$admin->setPassword($this->encoder->hashPassword($admin, 'test'));
|
||||||
$admin->setNeedPwChange(false);
|
$admin->setNeedPwChange(false);
|
||||||
$admin->setGroup($this->getReference(GroupFixtures::ADMINS));
|
$admin->setGroup($this->getReference(GroupFixtures::ADMINS));
|
||||||
$manager->persist($admin);
|
$manager->persist($admin);
|
||||||
|
@ -79,14 +80,14 @@ class UserFixtures extends Fixture
|
||||||
$user->setName('user');
|
$user->setName('user');
|
||||||
$user->setNeedPwChange(false);
|
$user->setNeedPwChange(false);
|
||||||
$user->setFirstName('Test')->setLastName('User');
|
$user->setFirstName('Test')->setLastName('User');
|
||||||
$user->setPassword($this->encoder->encodePassword($user, 'test'));
|
$user->setPassword($this->encoder->hashPassword($user, 'test'));
|
||||||
$user->setGroup($this->getReference(GroupFixtures::USERS));
|
$user->setGroup($this->getReference(GroupFixtures::USERS));
|
||||||
$manager->persist($user);
|
$manager->persist($user);
|
||||||
|
|
||||||
$noread = new User();
|
$noread = new User();
|
||||||
$noread->setName('noread');
|
$noread->setName('noread');
|
||||||
$noread->setNeedPwChange(false);
|
$noread->setNeedPwChange(false);
|
||||||
$noread->setPassword($this->encoder->encodePassword($noread, 'test'));
|
$noread->setPassword($this->encoder->hashPassword($noread, 'test'));
|
||||||
$manager->persist($noread);
|
$manager->persist($noread);
|
||||||
|
|
||||||
$manager->flush();
|
$manager->flush();
|
||||||
|
|
|
@ -57,6 +57,7 @@ use App\Entity\PriceInformations\Currency;
|
||||||
use App\Security\Interfaces\HasPermissionsInterface;
|
use App\Security\Interfaces\HasPermissionsInterface;
|
||||||
use App\Validator\Constraints\Selectable;
|
use App\Validator\Constraints\Selectable;
|
||||||
use App\Validator\Constraints\ValidPermission;
|
use App\Validator\Constraints\ValidPermission;
|
||||||
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||||
use function count;
|
use function count;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
@ -83,7 +84,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||||
* @ORM\EntityListeners({"App\EntityListeners\TreeCacheInvalidationListener"})
|
* @ORM\EntityListeners({"App\EntityListeners\TreeCacheInvalidationListener"})
|
||||||
* @UniqueEntity("name", message="validator.user.username_already_used")
|
* @UniqueEntity("name", message="validator.user.username_already_used")
|
||||||
*/
|
*/
|
||||||
class User extends AttachmentContainingDBElement implements UserInterface, HasPermissionsInterface, TwoFactorInterface, BackupCodeInterface, TrustedDeviceInterface, U2FTwoFactorInterface, PreferredProviderInterface
|
class User extends AttachmentContainingDBElement implements UserInterface, HasPermissionsInterface, TwoFactorInterface, BackupCodeInterface, TrustedDeviceInterface, U2FTwoFactorInterface, PreferredProviderInterface, PasswordAuthenticatedUserInterface
|
||||||
{
|
{
|
||||||
//use MasterAttachmentTrait;
|
//use MasterAttachmentTrait;
|
||||||
|
|
||||||
|
@ -306,6 +307,11 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
||||||
return (string) $this->name;
|
return (string) $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getUserIdentifier(): string
|
||||||
|
{
|
||||||
|
return $this->getUsername();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see UserInterface
|
* @see UserInterface
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -96,7 +96,7 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
|
||||||
$user = $this->security->getUser();
|
$user = $this->security->getUser();
|
||||||
$request = $event->getRequest();
|
$request = $event->getRequest();
|
||||||
|
|
||||||
if (!$event->isMasterRequest()) {
|
if (!$event->isMainRequest()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$user instanceof User) {
|
if (!$user instanceof User) {
|
||||||
|
|
|
@ -47,6 +47,8 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||||
use Symfony\Component\Mailer\MailerInterface;
|
use Symfony\Component\Mailer\MailerInterface;
|
||||||
use Symfony\Component\Mime\Address;
|
use Symfony\Component\Mime\Address;
|
||||||
|
use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface;
|
||||||
|
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||||
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
|
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
|
||||||
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
|
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
|
||||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||||
|
@ -61,12 +63,12 @@ class PasswordResetManager
|
||||||
protected $userPasswordEncoder;
|
protected $userPasswordEncoder;
|
||||||
|
|
||||||
public function __construct(MailerInterface $mailer, EntityManagerInterface $em,
|
public function __construct(MailerInterface $mailer, EntityManagerInterface $em,
|
||||||
TranslatorInterface $translator, UserPasswordEncoderInterface $userPasswordEncoder,
|
TranslatorInterface $translator, UserPasswordHasherInterface $userPasswordEncoder,
|
||||||
EncoderFactoryInterface $encoderFactory)
|
PasswordHasherFactoryInterface $encoderFactory)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->mailer = $mailer;
|
$this->mailer = $mailer;
|
||||||
$this->passwordEncoder = $encoderFactory->getEncoder(User::class);
|
$this->passwordEncoder = $encoderFactory->getPasswordHasher(User::class);
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->userPasswordEncoder = $userPasswordEncoder;
|
$this->userPasswordEncoder = $userPasswordEncoder;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +85,7 @@ class PasswordResetManager
|
||||||
}
|
}
|
||||||
|
|
||||||
$unencrypted_token = md5(random_bytes(32));
|
$unencrypted_token = md5(random_bytes(32));
|
||||||
$user->setPwResetToken($this->passwordEncoder->encodePassword($unencrypted_token, null));
|
$user->setPwResetToken($this->passwordEncoder->hash($unencrypted_token, null));
|
||||||
|
|
||||||
//Determine the expiration datetime of
|
//Determine the expiration datetime of
|
||||||
$expiration_date = new \DateTime();
|
$expiration_date = new \DateTime();
|
||||||
|
@ -138,12 +140,12 @@ class PasswordResetManager
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if token is valid
|
//Check if token is valid
|
||||||
if (!$this->passwordEncoder->isPasswordValid($user->getPwResetToken(), $token, null)) {
|
if (!$this->passwordEncoder->verify($user->getPwResetToken(), $token, null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//When everything was valid, apply the new password
|
//When everything was valid, apply the new password
|
||||||
$user->setPassword($this->userPasswordEncoder->encodePassword($user, $new_password));
|
$user->setPassword($this->userPasswordEncoder->hashPassword($user, $new_password));
|
||||||
|
|
||||||
//Remove token
|
//Remove token
|
||||||
$user->setPwResetToken(null);
|
$user->setPwResetToken(null);
|
||||||
|
|
|
@ -31,7 +31,7 @@ use Symfony\Component\Validator\Constraints\NumberConstraintTrait;
|
||||||
*/
|
*/
|
||||||
class BigDecimalPositive extends GreaterThan
|
class BigDecimalPositive extends GreaterThan
|
||||||
{
|
{
|
||||||
use NumberConstraintTrait;
|
use BigNumberConstraintTrait;
|
||||||
|
|
||||||
public $message = 'This value should be positive.';
|
public $message = 'This value should be positive.';
|
||||||
|
|
||||||
|
@ -44,4 +44,5 @@ class BigDecimalPositive extends GreaterThan
|
||||||
{
|
{
|
||||||
return BigDecimalGreaterThanValidator::class;
|
return BigDecimalGreaterThanValidator::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ use Symfony\Component\Validator\Constraints\NumberConstraintTrait;
|
||||||
*/
|
*/
|
||||||
class BigDecimalPositiveOrZero extends GreaterThanOrEqual
|
class BigDecimalPositiveOrZero extends GreaterThanOrEqual
|
||||||
{
|
{
|
||||||
use NumberConstraintTrait;
|
use BigNumberConstraintTrait;
|
||||||
|
|
||||||
public $message = 'This value should be either positive or zero.';
|
public $message = 'This value should be either positive or zero.';
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Validator\Constraints\BigDecimal;
|
||||||
|
|
||||||
|
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
|
||||||
|
|
||||||
|
trait BigNumberConstraintTrait
|
||||||
|
{
|
||||||
|
private function configureNumberConstraintOptions($options): array
|
||||||
|
{
|
||||||
|
if (null === $options) {
|
||||||
|
$options = [];
|
||||||
|
} elseif (!\is_array($options)) {
|
||||||
|
$options = [$this->getDefaultOption() => $options];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($options['propertyPath'])) {
|
||||||
|
throw new ConstraintDefinitionException(sprintf('The "propertyPath" option of the "%s" constraint cannot be set.', static::class));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($options['value'])) {
|
||||||
|
throw new ConstraintDefinitionException(sprintf('The "value" option of the "%s" constraint cannot be set.', static::class));
|
||||||
|
}
|
||||||
|
|
||||||
|
$options['value'] = 0;
|
||||||
|
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue