mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Fix psalm errors
This commit is contained in:
parent
f869f98ac1
commit
c0166ee9ba
1 changed files with 3 additions and 3 deletions
|
@ -53,7 +53,7 @@ class ItemFactory {
|
|||
* @var \WC_Product $product
|
||||
*/
|
||||
$quantity = (int) $item['quantity'];
|
||||
$image = wp_get_attachment_image_src( $product->get_image_id(), 'full' );
|
||||
$image = wp_get_attachment_image_src( (int) $product->get_image_id(), 'full' );
|
||||
|
||||
$price = (float) $item['line_subtotal'] / (float) $item['quantity'];
|
||||
return new Item(
|
||||
|
@ -131,7 +131,7 @@ class ItemFactory {
|
|||
$quantity = (int) $item->get_quantity();
|
||||
$price_without_tax = (float) $order->get_item_subtotal( $item, false );
|
||||
$price_without_tax_rounded = round( $price_without_tax, 2 );
|
||||
$image = wp_get_attachment_image_src( $product->get_image_id(), 'full' );
|
||||
$image = $product instanceof WC_Product ? wp_get_attachment_image_src( (int) $product->get_image_id(), 'full' ) : '';
|
||||
|
||||
return new Item(
|
||||
mb_substr( $item->get_name(), 0, 127 ),
|
||||
|
@ -141,7 +141,7 @@ class ItemFactory {
|
|||
null,
|
||||
$product instanceof WC_Product ? $product->get_sku() : '',
|
||||
( $product instanceof WC_Product && $product->is_virtual() ) ? Item::DIGITAL_GOODS : Item::PHYSICAL_GOODS,
|
||||
$product->get_permalink(),
|
||||
$product instanceof WC_Product ? $product->get_permalink() : '',
|
||||
$image[0] ?? ''
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue