mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Merge pull request #1804 from woocommerce/PCP-2104-warnings-on-php-8-1
Handle undefined array key warnings on PHP 8.1 (2104)
This commit is contained in:
commit
ad055d1e11
2 changed files with 3 additions and 3 deletions
|
@ -48,8 +48,8 @@ class ApiModule implements ModuleInterface {
|
|||
'ppcp_create_order_request_body_data',
|
||||
function( array $data ) use ( $c ) {
|
||||
|
||||
foreach ( $data['purchase_units'] as $purchase_unit_index => $purchase_unit ) {
|
||||
foreach ( $purchase_unit['items'] as $item_index => $item ) {
|
||||
foreach ( ( $data['purchase_units'] ?? array() ) as $purchase_unit_index => $purchase_unit ) {
|
||||
foreach ( ( $purchase_unit['items'] ?? array() ) as $item_index => $item ) {
|
||||
$data['purchase_units'][ $purchase_unit_index ]['items'][ $item_index ]['name'] =
|
||||
apply_filters( 'woocommerce_paypal_payments_cart_line_item_name', $item['name'], $item['cart_item_key'] ?? null );
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class OrderTransient {
|
|||
$transient = array();
|
||||
}
|
||||
|
||||
if ( ! is_array( $transient['notes'] ) ) {
|
||||
if ( ! is_array( $transient['notes'] ?? null ) ) {
|
||||
$transient['notes'] = array();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue