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

Breadcrumb

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

function StringConstraint::strlen

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

File

vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php, line 51

Class

StringConstraint
The StringConstraint Constraints, validates an string against a given schema

Namespace

JsonSchema\Constraints

Code

private function strlen($string) {
    if (extension_loaded('mbstring')) {
        return mb_strlen($string, mb_detect_encoding($string));
    }
    // mbstring is present on all test platforms, so strlen() can be ignored for coverage
    return strlen($string);
    // @codeCoverageIgnore
}

API Navigation

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