Code Duplication    Length = 9-9 lines in 2 locations

src/Http/Controllers/EventController.php 2 locations

@@ 924-932 (lines=9) @@
921
                $format = 'the %s day of the month';
922
                $ret = sprintf($format, $dayNumberOrdinal);
923
                break;
924
            case '1':  // 1|2|4 eg. the 2nd Thursday of the month
925
                $dayNumber = $onMonthlyKindCodeArray[1];
926
                $ordinalIndicator = $this->getOrdinalIndicator($dayNumber);
927
928
                $dayNumberOrdinal = $dayNumber.$ordinalIndicator;
929
                $weekDay = $weekDays[$onMonthlyKindCodeArray[2]]; // Monday, Tuesday, Wednesday
930
                $format = 'the %s %s of the month';
931
                $ret = sprintf($format, $dayNumberOrdinal, $weekDay);
932
                break;
933
            case '2': // 2|20 eg. the 21th to last day of the month
934
                $dayNumber = $onMonthlyKindCodeArray[1] + 1;
935
                $ordinalIndicator = $this->getOrdinalIndicator($dayNumber);
@@ 941-949 (lines=9) @@
938
                $format = 'the %s to last day of the month';
939
                $ret = sprintf($format, $dayNumberOrdinal);
940
                break;
941
            case '3': // 3|3|4 eg. the 4th to last Thursday of the month
942
                $dayNumber = $onMonthlyKindCodeArray[1] + 1;
943
                $ordinalIndicator = $this->getOrdinalIndicator($dayNumber);
944
945
                $dayNumberOrdinal = $dayNumber.$ordinalIndicator;
946
                $weekDay = $weekDays[$onMonthlyKindCodeArray[2]]; // Monday, Tuesday, Wednesday
947
                $format = 'the %s to last %s of the month';
948
                $ret = sprintf($format, $dayNumberOrdinal, $weekDay);
949
                break;
950
        }
951
952
        return $ret;