Code Duplication    Length = 5-5 lines in 2 locations

json-endpoints/class.wpcom-json-api-list-posts-endpoint.php 1 location

@@ 91-95 (lines=5) @@
88
89
		// Normalize post_type
90
		if ( isset( $args['type'] ) && 'any' == $args['type'] ) {
91
			if ( version_compare( $this->api->version, '1.1', '<' ) ) {
92
				$args['type'] = array( 'post', 'page' );
93
			} else { // 1.1+
94
				$args['type'] = $this->_get_whitelisted_post_types();
95
			}
96
		}
97
98
		// determine statuses

json-endpoints/class.wpcom-json-api-list-posts-v1-1-endpoint.php 1 location

@@ 94-98 (lines=5) @@
91
92
		// Normalize post_type
93
		if ( isset( $args['type'] ) && 'any' == $args['type'] ) {
94
			if ( version_compare( $this->api->version, '1.1', '<' ) ) {
95
				$args['type'] = array( 'post', 'page' );
96
			} else { // 1.1+
97
				$args['type'] = $site->get_whitelisted_post_types();
98
			}
99
		}
100
101
		// determine statuses