src/AbstractMessage.php
final public function isInSet($fieldName, $value)
    {
        if (empty($this->data[$fieldName]) || !is_array($this->data[$fieldName])) {
            return false;
        }

        if (is_scalar($value) || (is_object($value) && method_exists($value, '__toString'))) {
            $key = trim((string) $value);
        } else {
            return false;
        }

        if (0 === strlen($key)) {
            return false;
        }

        return isset($this->data[$fieldName][strtolower($key)]);
    }
final public function isInSet($fieldName, $value)
    {
        if (empty($this->data[$fieldName]) || !is_array($this->data[$fieldName])) {
            return false;
        }

        if (is_scalar($value) || (is_object($value) && method_exists($value, '__toString'))) {
            $key = trim((string) $value);
        } else {
            return false;
        }

        if (0 === strlen($key)) {
            return false;
        }

        return isset($this->data[$fieldName][strtolower($key)]);
    }
{@inheritdoc}