fix: Use odolbeau/phone-number-bundle for formatting phone number type fields.

There is no need to use the bundle, we could have used the library instead. However, this idea is to switch to that bundle at some point.
This commit is contained in:
Pol Dellaiera
2022-02-01 16:20:45 +01:00
parent 822f0aa737
commit 4822acb6fb
7 changed files with 112 additions and 53 deletions

View File

@@ -11,24 +11,21 @@ declare(strict_types=1);
namespace Chill\MainBundle\Validation\Validator;
use Chill\MainBundle\Phonenumber\PhonenumberHelper;
use Chill\MainBundle\Phonenumber\PhoneNumberHelperInterface;
use LogicException;
use Psr\Log\LoggerInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
class ValidPhonenumber extends ConstraintValidator
final class ValidPhonenumber extends ConstraintValidator
{
protected $logger;
private LoggerInterface $logger;
/**
* @var PhonenumberHelper
*/
protected $phonenumberHelper;
private PhoneNumberHelperInterface $phonenumberHelper;
public function __construct(
LoggerInterface $logger,
PhonenumberHelper $phonenumberHelper
PhoneNumberHelperInterface $phonenumberHelper
) {
$this->phonenumberHelper = $phonenumberHelper;
$this->logger = $logger;