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\ConstraintCode
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;
}