Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 963-965 (lines=3) @@
960
	 */
961
	public static function deactivate_module( $data ) {
962
		if ( Jetpack::is_module( $data['slug'] ) ) {
963
			if ( ! Jetpack::is_module_active( $data['slug'] ) ) {
964
				return new WP_Error( 'already_inactive', esc_html__( 'The requested Jetpack module was already inactive.', 'jetpack' ), array( 'status' => 409 ) );
965
			}
966
			if ( Jetpack::deactivate_module( $data['slug'] ) ) {
967
				return rest_ensure_response( array(
968
					'code' 	  => 'success',
@@ 996-998 (lines=3) @@
993
			return new WP_Error( 'not_found', esc_html__( 'The requested Jetpack module was not found.', 'jetpack' ), array( 'status' => 404 ) );
994
		}
995
996
		if ( ! Jetpack::is_module_active( $data['slug'] ) ) {
997
			return new WP_Error( 'inactive', esc_html__( 'The requested Jetpack module is inactive.', 'jetpack' ), array( 'status' => 409 ) );
998
		}
999
1000
		// Get parameters to update the module.
1001
		$param = $data->get_json_params();