WooCommerce shipping cost calculation in custom shipping method plugin [duplicate]
Your class WC_Your_Shipping_Method extends WC_Shipping_Method which has that method already.Turn this:
public function calculate_shipping( $package )
Into this:
public function calculate_shipping( $package = array() )