Code Duplication    Length = 11-11 lines in 3 locations

src/wp-includes/class-wp-comment-query.php 1 location

@@ 1096-1106 (lines=11) @@
1093
	 * @param string $order The 'order' query variable.
1094
	 * @return string The sanitized 'order' query variable.
1095
	 */
1096
	protected function parse_order( $order ) {
1097
		if ( ! is_string( $order ) || empty( $order ) ) {
1098
			return 'DESC';
1099
		}
1100
1101
		if ( 'ASC' === strtoupper( $order ) ) {
1102
			return 'ASC';
1103
		} else {
1104
			return 'DESC';
1105
		}
1106
	}
1107
}
1108

src/wp-includes/class-wp-user-query.php 1 location

@@ 710-720 (lines=11) @@
707
	 * @param string $order The 'order' query variable.
708
	 * @return string The sanitized 'order' query variable.
709
	 */
710
	protected function parse_order( $order ) {
711
		if ( ! is_string( $order ) || empty( $order ) ) {
712
			return 'DESC';
713
		}
714
715
		if ( 'ASC' === strtoupper( $order ) ) {
716
			return 'ASC';
717
		} else {
718
			return 'DESC';
719
		}
720
	}
721
722
	/**
723
	 * Make private properties readable for backwards compatibility.

src/wp-includes/query.php 1 location

@@ 2404-2414 (lines=11) @@
2401
	 * @param string $order The 'order' query variable.
2402
	 * @return string The sanitized 'order' query variable.
2403
	 */
2404
	protected function parse_order( $order ) {
2405
		if ( ! is_string( $order ) || empty( $order ) ) {
2406
			return 'DESC';
2407
		}
2408
2409
		if ( 'ASC' === strtoupper( $order ) ) {
2410
			return 'ASC';
2411
		} else {
2412
			return 'DESC';
2413
		}
2414
	}
2415
2416
	/**
2417
	 * Sets the 404 property and saves whether query is feed.