Code Duplication    Length = 8-8 lines in 2 locations

src/Serializer/Callback.php 2 locations

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