Code Duplication    Length = 3-3 lines in 3 locations

json-endpoints/class.wpcom-json-api-update-taxonomy-endpoint.php 1 location

@@ 192-194 (lines=3) @@
189
	function new_taxonomy( $path, $blog_id, $taxonomy_type ) {
190
		$args  = $this->query_args();
191
		$input = $this->input();
192
		if ( !is_array( $input ) || !$input || !strlen( $input['name'] ) ) {
193
			return new WP_Error( 'invalid_input', 'Unknown data passed', 400 );
194
		}
195
196
		$user = wp_get_current_user();
197
		if ( !$user || is_wp_error( $user ) || !$user->ID ) {

json-endpoints/class.wpcom-json-api-update-term-endpoint.php 1 location

@@ 121-123 (lines=3) @@
118
	function new_term( $path, $blog_id, $taxonomy ) {
119
		$args = $this->query_args();
120
		$input = $this->input();
121
		if ( ! is_array( $input ) || ! $input || ! strlen( $input['name'] ) ) {
122
			return new WP_Error( 'invalid_input', 'Unknown data passed', 400 );
123
		}
124
125
		$tax = get_taxonomy( $taxonomy );
126
		if ( ! current_user_can( $tax->cap->manage_terms ) ) {

json-endpoints/class.wpcom-json-api-update-comment-endpoint.php 1 location

@@ 214-216 (lines=3) @@
211
212
		$args  = $this->query_args();
213
		$input = $this->input();
214
		if ( !is_array( $input ) || !$input || !strlen( $input['content'] ) ) {
215
			return new WP_Error( 'invalid_input', 'Invalid request input', 400 );
216
		}
217
218
		$user = wp_get_current_user();
219
		if ( !$user || is_wp_error( $user ) || !$user->ID ) {