Code Duplication    Length = 11-11 lines in 4 locations

src/IntervalComparator.php 4 locations

@@ 115-125 (lines=11) @@
112
113
        $type = IntervalType::TYPE_CLOSED;
114
115
        if ($this->interval->startPoint()->lt($interval->startPoint())) {
116
            $start = $interval->startPoint();
117
            if ($interval->type()->startExcluded()) {
118
                $type |= IntervalType::TYPE_START_EXCLUDED;
119
            }
120
        } else {
121
            $start = $this->interval->startPoint();
122
            if ($this->interval->type()->startExcluded()) {
123
                $type |= IntervalType::TYPE_START_EXCLUDED;
124
            }
125
        }
126
127
        if ($this->interval->endPoint()->gt($interval->endPoint())) {
128
            $end = $interval->endPoint();
@@ 127-137 (lines=11) @@
124
            }
125
        }
126
127
        if ($this->interval->endPoint()->gt($interval->endPoint())) {
128
            $end = $interval->endPoint();
129
            if ($interval->type()->endExcluded()) {
130
                $type |= IntervalType::TYPE_END_EXCLUDED;
131
            }
132
        } else {
133
            $end = $this->interval->endPoint();
134
            if ($this->interval->type()->endExcluded()) {
135
                $type |= IntervalType::TYPE_END_EXCLUDED;
136
            }
137
        }
138
139
        return $this->interval
140
            ->withStart($start)
@@ 156-166 (lines=11) @@
153
    {
154
        $type = IntervalType::TYPE_CLOSED;
155
156
        if ($this->interval->startPoint()->lt($interval->startPoint())) {
157
            $start = $this->interval->startPoint();
158
            if ($this->interval->type()->startExcluded()) {
159
                $type |= IntervalType::TYPE_START_EXCLUDED;
160
            }
161
        } else {
162
            $start = $interval->startPoint();
163
            if ($interval->type()->startExcluded()) {
164
                $type |= IntervalType::TYPE_START_EXCLUDED;
165
            }
166
        }
167
168
        if ($this->interval->endPoint()->gt($interval->endPoint())) {
169
            $end = $this->interval->endPoint();
@@ 168-178 (lines=11) @@
165
            }
166
        }
167
168
        if ($this->interval->endPoint()->gt($interval->endPoint())) {
169
            $end = $this->interval->endPoint();
170
            if ($this->interval->type()->endExcluded()) {
171
                $type |= IntervalType::TYPE_END_EXCLUDED;
172
            }
173
        } else {
174
            $end = $interval->endPoint();
175
            if ($interval->type()->endExcluded()) {
176
                $type |= IntervalType::TYPE_END_EXCLUDED;
177
            }
178
        }
179
180
        return $this->interval
181
            ->withStart($start)