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

Breadcrumb

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

function StringContains::getDetectedEncoding

2 calls to StringContains::getDetectedEncoding()
StringContains::failureDescription in vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php
Returns the description of the failure.
StringContains::toString in vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php
Returns a string representation of the constraint.

File

vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php, line 118

Class

StringContains
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Framework\Constraint

Code

private function getDetectedEncoding(mixed $other) : string {
    if ($this->ignoreCase) {
        return 'Encoding ignored';
    }
    if (!is_string($other)) {
        return 'Encoding detection failed';
    }
    $detectedEncoding = mb_detect_encoding($other, null, true);
    if ($detectedEncoding === false) {
        return 'Encoding detection failed';
    }
    return $detectedEncoding;
}
RSS feed
Powered by Drupal