Code Duplication    Length = 17-17 lines in 2 locations

json-endpoints/class.wpcom-json-api-get-taxonomies-endpoint.php 2 locations

@@ 109-125 (lines=17) @@
106
		return $args;
107
	}
108
109
	function categories( $args ) {
110
		$args['get'] = 'all';
111
112
		$cats = get_categories( $args );
113
		unset( $args['offset'] );
114
		$found = wp_count_terms( 'category', $args );
115
116
		$cats_obj = array();
117
		foreach ( $cats as $cat ) {
118
			$cats_obj[] = $this->format_taxonomy( $cat, 'category', 'display' );
119
		}
120
121
		return array(
122
			'found'       => (int) $found,
123
			'categories'  => $cats_obj
124
		);
125
	}
126
127
	function tags( $args ) {
128
		$args['get'] = 'all';
@@ 127-143 (lines=17) @@
124
		);
125
	}
126
127
	function tags( $args ) {
128
		$args['get'] = 'all';
129
130
		$tags = (array) get_tags( $args );
131
		unset( $args['offset'] );
132
		$found = wp_count_terms( 'post_tag', $args );
133
134
		$tags_obj = array();
135
		foreach ( $tags as $tag ) {
136
			$tags_obj[] = $this->format_taxonomy( $tag, 'post_tag', 'display' );
137
		}
138
139
		return array(
140
			'found' => (int) $found,
141
			'tags'  => $tags_obj
142
		);
143
	}
144
}
145