Code Duplication    Length = 11-11 lines in 2 locations

includes/events/events.php 2 locations

@@ 276-286 (lines=11) @@
273
	 *
274
	 * @return Events
275
	 */
276
	public function future( $present = '' ) {
277
		$last = $this->get_last();
278
		$to = $last instanceof Event ? $last->start_utc : false;
279
		if ( $to ) {
280
			if ( empty( $present ) ) {
281
				$present = Carbon::now( $this->timezone )->getTimestamp();
282
			}
283
			$this->set_events( $this->filter_events( intval( $present ), $to ) );
284
		}
285
		return $this;
286
	}
287
288
	/**
289
	 * Filter events in the future.
@@ 297-307 (lines=11) @@
294
	 *
295
	 * @return Events
296
	 */
297
	public function past( $present = '' ) {
298
		$first = $this->get_last();
299
		$from  = $first instanceof Event ? $first->start_utc : false;
300
		if ( $from ) {
301
			if ( empty( $present ) ) {
302
				$present = Carbon::now( $this->timezone )->getTimestamp();
303
			}
304
			$this->set_events( $this->filter_events( $from, intval( $present ) ) );
305
		}
306
		return $this;
307
	}
308
309
	/**
310
	 * Filter events after time.