src/AbstractMessage.php
final public function addToSet($fieldName, array $values)
    {
        $this->guardFrozenMessage();
        $field = static::schema()->getField($fieldName);
        Assertion::true($field->isASet(), sprintf('Field [%s] must be a set.', $fieldName), $fieldName);

        foreach ($values as $value) {
            if (0 === strlen($value)) {
                continue;
            }
            $field->guardValue($value);
            $key = strtolower(trim((string) $value));
            $this->data[$fieldName][$key] = $value;
        }

        if (!empty($this->data[$fieldName])) {
            unset($this->clearedFields[$fieldName]);
        }

        return $this;
    }
final public function addToSet($fieldName, array $values)
    {
        $this->guardFrozenMessage();
        $field = static::schema()->getField($fieldName);
        Assertion::true($field->isASet(), sprintf('Field [%s] must be a set.', $fieldName), $fieldName);

        foreach ($values as $value) {
            if (0 === strlen($value)) {
                continue;
            }
            $field->guardValue($value);
            $key = strtolower(trim((string) $value));
            $this->data[$fieldName][$key] = $value;
        }

        if (!empty($this->data[$fieldName])) {
            unset($this->clearedFields[$fieldName]);
        }

        return $this;
    }
{@inheritdoc}
@return static