src/Definition/Type/SetType.php
public function denormalize($data)
    {
        if (!\is_array($data)) {
            throw new DenormalizationException('The value must be an array');
        }

        $set = $this->denormalized;

        try {
            foreach ($data as $value) {
                $set = $set->add(
                    $this->inner->denormalize($value)
                );
            }

            return $set;
        } catch (\Throwable $e) {
            throw new DenormalizationException('The value must be a valid set');
        }
    }
public function denormalize($data)
    {
        if (!\is_array($data)) {
            throw new DenormalizationException('The value must be an array');
        }

        $set = $this->denormalized;

        try {
            foreach ($data as $value) {
                $set = $set->add(
                    $this->inner->denormalize($value)
                );
            }

            return $set;
        } catch (\Throwable $e) {
            throw new DenormalizationException('The value must be a valid set');
        }
    }
{@inheritdoc}