Code Duplication    Length = 3-3 lines in 2 locations

src/Calendar.php 2 locations

@@ 56-58 (lines=3) @@
53
        array $timestamps = array(),
54
        array $openingHours = array()
55
    ) {
56
        if (($type->is(CalendarType::MULTIPLE()) || $type->is(CalendarType::SINGLE())) && empty($startDate)) {
57
            throw new \UnexpectedValueException('Start date can not be empty for calendar type: ' . $type . '.');
58
        }
59
60
        if ($type->is(CalendarType::SINGLE()) && empty($endDate)) {
61
            throw new \UnexpectedValueException('End date can not be empty for calendar type: ' . $type . '.');
@@ 60-62 (lines=3) @@
57
            throw new \UnexpectedValueException('Start date can not be empty for calendar type: ' . $type . '.');
58
        }
59
60
        if ($type->is(CalendarType::SINGLE()) && empty($endDate)) {
61
            throw new \UnexpectedValueException('End date can not be empty for calendar type: ' . $type . '.');
62
        }
63
64
        if ($type->is(CalendarType::PERIODIC()) && (empty($startDate) || empty($endDate))) {
65
            throw new \UnexpectedValueException('A period should have a start- and end-date.');