Code Duplication    Length = 3-3 lines in 2 locations

src/CSV.php 2 locations

@@ 219-221 (lines=3) @@
216
					}
217
				}
218
				// Dates.
219
				if ( 'date' === $column->get_type() && ! empty( $value ) && 1 !== preg_match( '/\d{4}-\d{2}-\d{2}/', $value ) ) {
220
					$col_errors[] = 'Value (' . $value . ') not in date format';
221
				}
222
				if ( 'year' === $column->get_type() && ! empty( $value ) && ( $value < 1901 || $value > 2155 ) ) {
223
					$col_errors[] = 'Year values must be between 1901 and 2155 (' . $value . ' given)';
224
				}
@@ 222-224 (lines=3) @@
219
				if ( 'date' === $column->get_type() && ! empty( $value ) && 1 !== preg_match( '/\d{4}-\d{2}-\d{2}/', $value ) ) {
220
					$col_errors[] = 'Value (' . $value . ') not in date format';
221
				}
222
				if ( 'year' === $column->get_type() && ! empty( $value ) && ( $value < 1901 || $value > 2155 ) ) {
223
					$col_errors[] = 'Year values must be between 1901 and 2155 (' . $value . ' given)';
224
				}
225
226
				if ( count( $col_errors ) > 0 ) {
227
					// Construct error details array.