Code Duplication    Length = 8-8 lines in 2 locations

src/Serializer/Callback.php 2 locations

@@ 36-43 (lines=8) @@
33
        }
34
    }
35
36
    public function setGroups(array $groups): void
37
    {
38
        $this->groups = $groups;
39
40
        if (!empty($this->groups) && !$this->serializer instanceof SerializerInterface && !$this->serializer instanceof JMSSerializer) {
41
            throw new \RuntimeException('Setting serialization groups requires using "JMS\Serializer\Serializer" or "Symfony\Component\Serializer\Serializer".');
42
        }
43
    }
44
45
    /**
46
     * @param mixed $version
@@ 57-64 (lines=8) @@
54
        }
55
    }
56
57
    public function setSerializeNull(bool $serializeNull): void
58
    {
59
        $this->serializeNull = $serializeNull;
60
61
        if (true === $this->serializeNull && !$this->serializer instanceof SerializerInterface && !$this->serializer instanceof JMSSerializer) {
62
            throw new \RuntimeException('Setting null value serialization option requires using "JMS\Serializer\Serializer" or "Symfony\Component\Serializer\Serializer".');
63
        }
64
    }
65
66
    /**
67
     * @param $object