function MacAddress::__construct
Parameters
self::ALL*|self::LOCAL_*|self::UNIVERSAL_*|self::UNICAST_*|self::MULTICAST_*|self::BROADCAST $type A mac address type to validate (defaults to {@see self::ALL}):
Overrides Constraint::__construct
File
-
vendor/
symfony/ validator/ Constraints/ MacAddress.php, line 69
Class
- MacAddress
- Validates that a value is a valid MAC address.
Namespace
Symfony\Component\Validator\ConstraintsCode
public function __construct(string $message = 'This value is not a valid MAC address.', string $type = self::ALL, ?callable $normalizer = null, ?array $groups = null, mixed $payload = null) {
parent::__construct(null, $groups, $payload);
if (!\in_array($this->type, self::TYPES, true)) {
throw new ConstraintDefinitionException(\sprintf('The option "type" must be one of "%s".', implode('", "', self::TYPES)));
}
$this->normalizer = null !== $normalizer ? $normalizer(...) : null;
}