Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MacAddressValidator.php

function MacAddressValidator::isUnicast

Checks whether a MAC address is unicast or multicast.

File

vendor/symfony/validator/Constraints/MacAddressValidator.php, line 84

Class

MacAddressValidator
Validates whether a value is a valid MAC address.

Namespace

Symfony\Component\Validator\Constraints

Code

private static function isUnicast(string $mac) : bool {
    return match (self::sanitize($mac)[1]) {    '0', '4', '8', 'c', '2', '6', 'a', 'e' => true,
        default => false,
    
    };
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal