function GPBUtil::checkString
103 calls to GPBUtil::checkString()
- Annotation::setSourceFile in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GeneratedCodeInfo/ Annotation.php - Identifies the filesystem path to the original source .proto.
- Any::setTypeUrl in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Any.php - A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent the fully qualified name of the type…
- Any::setValue in vendor/
google/ protobuf/ src/ Google/ Protobuf/ Any.php - Must be a valid serialized protocol buffer of the above specified type.
- AnyValue::setBytesValue in vendor/
open-telemetry/ gen-otlp-protobuf/ Opentelemetry/ Proto/ Common/ V1/ AnyValue.php - Generated from protobuf field <code>bytes bytes_value = 7;</code>
- AnyValue::setStringValue in vendor/
open-telemetry/ gen-otlp-protobuf/ Opentelemetry/ Proto/ Common/ V1/ AnyValue.php - Generated from protobuf field <code>string string_value = 1;</code>
File
-
vendor/
google/ protobuf/ src/ Google/ Protobuf/ Internal/ GPBUtil.php, line 71
Class
Namespace
Google\Protobuf\InternalCode
public static function checkString(&$var, $check_utf8) {
if (is_array($var) || is_object($var)) {
throw new \InvalidArgumentException("Expect string.");
}
if (!is_string($var)) {
$var = strval($var);
}
if ($check_utf8 && !preg_match('//u', $var)) {
throw new \Exception("Expect utf-8 encoding.");
}
}