diff --git a/src/Twig/Extension/PhoneNumberHelperExtension.php b/src/Twig/Extension/PhoneNumberHelperExtension.php index 3b31e71e..69304c4f 100644 --- a/src/Twig/Extension/PhoneNumberHelperExtension.php +++ b/src/Twig/Extension/PhoneNumberHelperExtension.php @@ -16,7 +16,6 @@ use Misd\PhoneNumberBundle\Templating\Helper\PhoneNumberHelper; use Twig\Extension\AbstractExtension; use Twig\TwigFilter; -use Twig\TwigFunction; use Twig\TwigTest; /** @@ -41,15 +40,6 @@ public function __construct(PhoneNumberHelper $helper) $this->helper = $helper; } - public function getFunctions(): array - { - return [ - // Deprecated in favor of the phone_number_format filter - new TwigFunction('phone_number_format', [$this->helper, 'format'], ['deprecated' => '1.2']), - new TwigFunction('phone_number_is_type', [$this->helper, 'isType'], ['deprecated' => '1.2']), - ]; - } - public function getFilters(): array { return [ diff --git a/src/Validator/Constraints/PhoneNumber.php b/src/Validator/Constraints/PhoneNumber.php index 26b3a7ff..792362cb 100644 --- a/src/Validator/Constraints/PhoneNumber.php +++ b/src/Validator/Constraints/PhoneNumber.php @@ -44,13 +44,6 @@ class PhoneNumber extends Constraint self::INVALID_PHONE_NUMBER_ERROR => 'INVALID_PHONE_NUMBER_ERROR', ]; - /** - * @deprecated since PhoneNumberBundle 3.6, use const ERROR_NAMES instead - * - * @var string[] - */ - protected static array $errorNames = self::ERROR_NAMES; - public ?string $message = null; /** * @var string|string[] @@ -61,42 +54,22 @@ class PhoneNumber extends Constraint public ?int $format = null; /** - * @param int|array|null $format Specify the format (\libphonenumber\PhoneNumberFormat::*) - * or options (an associative array) - * @param string|string[]|null $type - * @param array $options + * @param int|null $format Specify the format (\libphonenumber\PhoneNumberFormat::*) + * @param string|string[]|null $type + * @param array $options */ #[HasNamedArguments] - public function __construct(int|array $format = null, string|array $type = null, string $defaultRegion = null, string $regionPath = null, string $message = null, array $groups = null, $payload = null, array $options = []) + public function __construct(int $format = null, string|array $type = null, string $defaultRegion = null, string $regionPath = null, string $message = null, array $groups = null, $payload = null, array $options = []) { - if (\is_array($format)) { - @trigger_error('Usage of the argument $format to specify options is deprecated and will be removed in 4.0. Use "$option" argument instead.', \E_USER_DEPRECATED); - $options = array_merge($format, $options); - } else { - $phoneFormat = $format; - } - parent::__construct($options, $groups, $payload); $this->message = $message ?? $this->message; - $this->format = $phoneFormat ?? $this->format; + $this->format = $format ?? $this->format; $this->type = $type ?? $this->type; $this->defaultRegion = $defaultRegion ?? $this->defaultRegion; $this->regionPath = $regionPath ?? $this->regionPath; } - public function getType(): ?string - { - @trigger_error(__METHOD__.' is deprecated and will be removed in 4.0. Use "getTypes" instead.', \E_USER_DEPRECATED); - - $types = $this->getTypes(); - if (0 === \count($types)) { - return null; - } - - return reset($types); - } - /** * @return string[] */