Fix psalm problems

This commit is contained in:
Narek Zakarian 2024-05-15 14:36:13 +04:00
parent bfff4326a2
commit 89f26aa328
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
2 changed files with 16 additions and 6 deletions

View file

@ -620,13 +620,18 @@ class ApplePayButton implements ButtonInterface {
): array {
$shipping_methods_array = array();
$shipping_methods = WC()->shipping->calculate_shipping(
/**
* The argument is defined only in docblock.
*
* @psalm-suppress InvalidScalarArgument
*/
$shipping_methods = WC()->shipping->calculate_shipping(
$this->getShippingPackages(
$customer_address,
$cart->get_total( 'edit' )
)
);
$done = false;
$done = false;
foreach ( $shipping_methods[0]['rates'] as $rate ) {
$shipping_methods_array[] = array(
'label' => $rate->get_label(),