Fix psalm

This commit is contained in:
dinamiko 2022-08-02 16:58:47 +02:00
parent 5931c7d304
commit ca6f3dd088

View file

@ -25,7 +25,7 @@ class PaymentSourceFactory {
*/
public function from_wc_order( WC_Order $order, string $birth_date ) {
$address = $order->get_address();
$phone = filter_input( INPUT_POST, 'billing_phone', FILTER_SANITIZE_STRING ) ?? $address['phone'] ?? '';
$phone = filter_input( INPUT_POST, 'billing_phone', FILTER_SANITIZE_STRING ) ?? $address['phone'] ?: '';
$phone_country_code = WC()->countries->get_country_calling_code( $address['country'] );
$phone_country_code = is_array( $phone_country_code ) && ! empty( $phone_country_code ) ? $phone_country_code[0] : $phone_country_code;
if ( is_string( $phone_country_code ) && '' !== $phone_country_code ) {