Code Duplication    Length = 3-3 lines in 4 locations

includes/api/class-give-api.php 4 locations

@@ 1132-1134 (lines=3) @@
1129
				} elseif ( $args['date'] === 'range' ) {
1130
					// Return donations for a date range.
1131
					// Ensure the end date is later than the start date.
1132
					if ( $args['enddate'] < $args['startdate'] ) {
1133
						$error['error'] = __( 'The end date must be later than the start date.', 'give' );
1134
					}
1135
1136
					// Ensure both the start and end date are specified
1137
					if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) {
@@ 1137-1139 (lines=3) @@
1134
					}
1135
1136
					// Ensure both the start and end date are specified
1137
					if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) {
1138
						$error['error'] = __( 'Invalid or no date range specified.', 'give' );
1139
					}
1140
1141
					$total = 0;
1142
@@ 1247-1249 (lines=3) @@
1244
				} elseif ( $args['date'] === 'range' ) {
1245
					// Return sales for a date range
1246
					// Ensure the end date is later than the start date
1247
					if ( $args['enddate'] < $args['startdate'] ) {
1248
						$error['error'] = __( 'The end date must be later than the start date.', 'give' );
1249
					}
1250
1251
					// Ensure both the start and end date are specified
1252
					if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) {
@@ 1252-1254 (lines=3) @@
1249
					}
1250
1251
					// Ensure both the start and end date are specified
1252
					if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) {
1253
						$error['error'] = __( 'Invalid or no date range specified.', 'give' );
1254
					}
1255
1256
					$total = (float) 0.00;
1257