Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 999-1001 (lines=3) @@
996
	 */
997
	public static function deactivate_module( $data ) {
998
		if ( Jetpack::is_module( $data['slug'] ) ) {
999
			if ( ! Jetpack::is_module_active( $data['slug'] ) ) {
1000
				return new WP_Error( 'already_inactive', esc_html__( 'The requested Jetpack module was already inactive.', 'jetpack' ), array( 'status' => 409 ) );
1001
			}
1002
			if ( Jetpack::deactivate_module( $data['slug'] ) ) {
1003
				return rest_ensure_response( array(
1004
					'code' 	  => 'success',
@@ 1032-1034 (lines=3) @@
1029
			return new WP_Error( 'not_found', esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), array( 'status' => 404 ) );
1030
		}
1031
1032
		if ( ! Jetpack::is_module_active( $data['slug'] ) ) {
1033
			return new WP_Error( 'inactive', esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' ), array( 'status' => 409 ) );
1034
		}
1035
1036
		// Get parameters to update the module.
1037
		$param = $data->get_json_params();