Code Duplication    Length = 10-11 lines in 2 locations

src/Event/ValueObjects/SubEvents.php 2 locations

@@ 69-78 (lines=10) @@
66
        return false;
67
    }
68
69
    public function addSubEvent(SubEvent $subEvent): SubEvents
70
    {
71
        if ($this->hasSubEventWithTimestamp($subEvent->getTimestamp())) {
72
            return $this;
73
        }
74
75
        $this->subEvents[] = $subEvent;
76
77
        return $this;
78
    }
79
80
    public function updateSubEvent(SubEvent $subEvent): SubEvents
81
    {
@@ 80-90 (lines=11) @@
77
        return $this;
78
    }
79
80
    public function updateSubEvent(SubEvent $subEvent): SubEvents
81
    {
82
        if (!$this->hasSubEventWithTimestamp($subEvent->getTimestamp())) {
83
            return $this;
84
        }
85
86
        $this->removeSubEventWithTimestamp($subEvent->getTimestamp());
87
        $this->subEvents[] = $subEvent;
88
89
        return $this;
90
    }
91
92
    private function removeSubEventWithTimestamp(Timestamp $timestamp): SubEvents
93
    {