Code Duplication    Length = 3-3 lines in 2 locations

includes/api/class-wc-rest-payment-gateways-controller.php 2 locations

@@ 137-139 (lines=3) @@
134
		$this->maybe_define_wp_admin();
135
		$gateway = $this->get_gateway( $request );
136
137
		if ( is_null( $gateway ) ) {
138
			return new WP_Error( 'woocommerce_rest_payment_gateway_invalid', __( "Resource does not exist.", 'woocommerce' ), array( 'status' => 404 ) );
139
		}
140
141
		$gateway = $this->prepare_item_for_response( $gateway, $request );
142
		return rest_ensure_response( $gateway );
@@ 155-157 (lines=3) @@
152
		$this->maybe_define_wp_admin();
153
		$gateway = $this->get_gateway( $request );
154
155
		if ( is_null( $gateway ) ) {
156
			return new WP_Error( 'woocommerce_rest_payment_gateway_invalid', __( "Resource does not exist.", 'woocommerce' ), array( 'status' => 404 ) );
157
		}
158
159
		// Update settings if present
160
		if ( isset( $request['settings'] ) ) {