Code Duplication    Length = 9-9 lines in 2 locations

_inc/lib/icalendar-reader.php 2 locations

@@ 268-276 (lines=9) @@
265
							if ( strtotime( $recurring_event_date_start ) < $current ) {
266
								if ( $interval > 1 ) {
267
									$recurring_event_date_start = date( 'Ymd', strtotime( $event_date_desc . date( 'F Y', strtotime( '+ ' . ( $interval * $catchup ) . ' months', strtotime( $event['DTSTART'] ) ) ) ) ) . date( '\THis', strtotime( $event['DTSTART'] ) );
268
								} else {
269
									try {
270
										$adjustment = new DateTime( date( 'Y-m-d', $current ) );
271
										$adjustment->modify( 'first day of next month' );
272
										$recurring_event_date_start = date( 'Ymd', strtotime( $event_date_desc . $adjustment->format( 'F Y' ) ) ) . date( '\THis', strtotime( $event['DTSTART'] ) );
273
									} catch ( Exception $e ) {
274
										// Invalid argument to DateTime
275
									}
276
								}
277
							}
278
						}
279
						break;
@@ 289-297 (lines=9) @@
286
							$recurring_event_date_start = date( "Ymd\THis", strtotime( $event['DTSTART'] ) );
287
						} else {
288
							$recurring_event_date_start = date( 'Y', $current ) . date( "md\THis", strtotime( $event['DTSTART'] ) );
289
							if ( strtotime( $recurring_event_date_start ) < $current ) {
290
								try {
291
									$next = new DateTime( date( 'Y-m-d', $current ) );
292
									$next->modify( 'first day of next year' );
293
									$recurring_event_date_start = $next->format( 'Y' ) . date ( 'md\THis', strtotime( $event['DTSTART'] ) );
294
								} catch ( Exception $e ) {
295
									// Invalid argument to DateTime
296
								}
297
							}
298
						}
299
						break;
300