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

Breadcrumb

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

function Assert::strlen

4 calls to Assert::strlen()
Assert::length in vendor/webmozart/assert/src/Assert.php
@psalm-pure
Assert::lengthBetween in vendor/webmozart/assert/src/Assert.php
Inclusive , so Assert::lengthBetween('asd', 3, 5); passes the assertion.
Assert::maxLength in vendor/webmozart/assert/src/Assert.php
Inclusive max.
Assert::minLength in vendor/webmozart/assert/src/Assert.php
Inclusive min.

File

vendor/webmozart/assert/src/Assert.php, line 2051

Class

Assert
Efficient assertions to validate the input/output of your methods.

Namespace

Webmozart\Assert

Code

protected static function strlen($value) {
    if (!\function_exists('mb_detect_encoding')) {
        return \strlen($value);
    }
    if (false === ($encoding = \mb_detect_encoding($value))) {
        return \strlen($value);
    }
    return \mb_strlen($value, $encoding);
}

API Navigation

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