Code Duplication    Length = 3-3 lines in 2 locations

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

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