Cannot declare function twice – WordPress Development Stack Exchange

I have two hooks that i am using in the code snippets plugin:

add_filter( ‘woocommerce_package_rates’, ‘businessbloomer_hide_free_shipping_for_shipping_class’, 10, 2 );

function businessbloomer_hide_free_shipping_for_shipping_class( $rates, $package ) {

$shipping_class_target = ‘1173’; // This is Deluxe Tables shipping class ID
$in_cart = false;
foreach ( WC()->cart->get_cart_contents() as $key => $values ) {
if ( $values( ‘data’ )->get_shipping_class_id() == $shipping_class_target ) {
$in_cart = true;
break;
}
}
if ( $in_cart ) {
unset( $rates(‘local_pickup:45’) ); // This is Local Pick up shipping method with ID
}
return $rates;
}

2.
add_filter( ‘woocommerce_package_rates’, ‘businessbloomer_hide_free_shipping_for_shipping_class’, 10, 2 );

function businessbloomer_hide_free_shipping_for_shipping_class( $rates, $package ) {

$shipping_class_target = ‘1750’; // This is Stag & Doe shipping class ID
$in_cart = false;
foreach ( WC()->cart->get_cart_contents() as $key => $values ) {
if ( $values( ‘data’ )->get_shipping_class_id() == $shipping_class_target ) {
$in_cart = true;
break;
}
}
if ( $in_cart ) {
unset( $rates(‘WB_Custom_WooCommerce_Shipping_Method52’) ); // This is Delivery shipping method with ID
}
return $rates;

}

If only one is activated at a time it works! But it says I cannot declare the function twice, so how do I combine these two? I have tried so many variations and nothing is working. Please help!