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

Breadcrumb

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

function MacAddressValidator::isLocal

Checks whether a MAC address is local or universal.

File

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

Class

MacAddressValidator
Validates whether a value is a valid MAC address.

Namespace

Symfony\Component\Validator\Constraints

Code

private static function isLocal(string $mac) : bool {
    return match (self::sanitize($mac)[1]) {    '2', '6', 'a', 'e', '3', '7', 'b', 'f' => true,
        default => false,
    
    };
}

API Navigation

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