Code Duplication    Length = 3-3 lines in 2 locations

_inc/lib/class.core-rest-api-endpoints.php 2 locations

@@ 1007-1009 (lines=3) @@
1004
	 */
1005
	public static function deactivate_module( $data ) {
1006
		if ( Jetpack::is_module( $data['slug'] ) ) {
1007
			if ( ! Jetpack::is_module_active( $data['slug'] ) ) {
1008
				return new WP_Error( 'already_inactive', esc_html__( 'The requested Jetpack module was already inactive.', 'jetpack' ), array( 'status' => 409 ) );
1009
			}
1010
			if ( Jetpack::deactivate_module( $data['slug'] ) ) {
1011
				return rest_ensure_response( array(
1012
					'code' 	  => 'success',
@@ 1040-1042 (lines=3) @@
1037
			return new WP_Error( 'not_found', esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), array( 'status' => 404 ) );
1038
		}
1039
1040
		if ( ! Jetpack::is_module_active( $data['slug'] ) ) {
1041
			return new WP_Error( 'inactive', esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' ), array( 'status' => 409 ) );
1042
		}
1043
1044
		// Get parameters to update the module.
1045
		$params = $data->get_json_params();