Code Duplication    Length = 10-10 lines in 2 locations

src/Set/ImmutableSet.php 2 locations

@@ 35-44 (lines=10) @@
32
     * @param Enum $enum
33
     * @return self
34
     */
35
    public function add(Enum $enum)
36
    {
37
        if (!($enum instanceof $this->enumClass)) {
38
            throw new EnumSetMustContainEnumsException(sprintf("Expected %s, got %s", $this->enumClass, get_class($enum)));
39
        }
40
        $set = $this->set;
41
        $set[(string) $enum] = $enum;
42
43
        return new ImmutableSet($this->enumClass, $set);
44
    }
45
46
    /**
47
     * @param Enum $enum
@@ 50-59 (lines=10) @@
47
     * @param Enum $enum
48
     * @return self
49
     */
50
    public function remove(Enum $enum)
51
    {
52
        if (!($enum instanceof $this->enumClass)) {
53
            throw new EnumSetMustContainEnumsException(sprintf("Expected %s, got %s", $this->enumClass, get_class($enum)));
54
        }
55
        $set = $this->set;
56
        unset($set[(string) $enum]);
57
58
        return new ImmutableSet($this->enumClass, $set);
59
    }
60
}
61