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

        $map = $this->denormalized;

        try {
            foreach ($data as $key => $value) {
                $map = $map->put(
                    $this->key->denormalize($key),
                    $this->value->denormalize($value)
                );
            }

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

        $map = $this->denormalized;

        try {
            foreach ($data as $key => $value) {
                $map = $map->put(
                    $this->key->denormalize($key),
                    $this->value->denormalize($value)
                );
            }

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