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

Breadcrumb

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

function FormatConstraint::validatePhone

1 call to FormatConstraint::validatePhone()
FormatConstraint::check in vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php
invokes the validation of an element

File

vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php, line 203

Class

FormatConstraint
Validates against the "format" property

Namespace

JsonSchema\Constraints

Code

protected function validatePhone($phone) {
    return preg_match('/^\\+?(\\(\\d{3}\\)|\\d{3}) \\d{3} \\d{4}$/', $phone);
}

API Navigation

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