Code Duplication    Length = 8-8 lines in 2 locations

src/Http/Controllers/EventController.php 2 locations

@@ 916-923 (lines=8) @@
913
914
        //dd($onMonthlyKindCodeArray);
915
        switch ($onMonthlyKindCodeArray[0]) {
916
            case '0':  // 0|7 eg. the 7th day of the month
917
                $dayNumber = $onMonthlyKindCodeArray[1];
918
                $ordinalIndicator = $this->getOrdinalIndicator($dayNumber);
919
920
                $dayNumberOrdinal = $dayNumber.$ordinalIndicator;
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);
@@ 933-940 (lines=8) @@
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);
936
937
                $dayNumberOrdinal = $dayNumber.$ordinalIndicator;
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);