Code Duplication    Length = 4-4 lines in 2 locations

json-endpoints/class.wpcom-json-api-site-user-endpoint.php 1 location

@@ 55-58 (lines=4) @@
52
53
	public function get_user( $user_id ) {
54
		$the_user = $this->get_author( $user_id, true );
55
		if ( $the_user && ! is_wp_error( $the_user ) ) {
56
			$userdata = get_userdata( $user_id );
57
			$the_user->roles = ! is_wp_error( $userdata ) ? array_values( $userdata->roles ) : array();
58
		}
59
60
		return $the_user;
61
	}

json-endpoints/jetpack/class.jetpack-json-api-user-create-endpoint.php 1 location

@@ 53-56 (lines=4) @@
50
51
	public function get_user( $user_id ) {
52
		$the_user = $this->get_author( $user_id, true );
53
		if ( $the_user && ! is_wp_error( $the_user ) ) {
54
			$userdata = get_userdata( $user_id );
55
			$the_user->roles = ! is_wp_error( $userdata ) ? $userdata->roles : array();
56
		}
57
58
		return $the_user;
59
	}