Code Duplication    Length = 3-3 lines in 4 locations

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

@@ 1176-1178 (lines=3) @@
1173
				} elseif ( $args['date'] === 'range' ) {
1174
					// Return donations for a date range.
1175
					// Ensure the end date is later than the start date.
1176
					if ( $args['enddate'] < $args['startdate'] ) {
1177
						$error['error'] = __( 'The end date must be later than the start date.', 'give' );
1178
					}
1179
1180
					// Ensure both the start and end date are specified
1181
					if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) {
@@ 1181-1183 (lines=3) @@
1178
					}
1179
1180
					// Ensure both the start and end date are specified
1181
					if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) {
1182
						$error['error'] = __( 'Invalid or no date range specified.', 'give' );
1183
					}
1184
1185
					$total = 0;
1186
@@ 1307-1309 (lines=3) @@
1304
				} elseif ( $args['date'] === 'range' ) {
1305
					// Return sales for a date range
1306
					// Ensure the end date is later than the start date
1307
					if ( $args['enddate'] < $args['startdate'] ) {
1308
						$error['error'] = __( 'The end date must be later than the start date.', 'give' );
1309
					}
1310
1311
					// Ensure both the start and end date are specified
1312
					if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) {
@@ 1312-1314 (lines=3) @@
1309
					}
1310
1311
					// Ensure both the start and end date are specified
1312
					if ( empty( $args['startdate'] ) || empty( $args['enddate'] ) ) {
1313
						$error['error'] = __( 'Invalid or no date range specified.', 'give' );
1314
					}
1315
1316
					$total = (float) 0.00;
1317