mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix psalm error
This commit is contained in:
parent
0947031c3f
commit
4b43e05d59
1 changed files with 8 additions and 5 deletions
|
@ -172,12 +172,15 @@ class PayerFactory {
|
|||
// make sure the phone number contains only numbers and is max 14. chars long.
|
||||
$national_number = $form_fields['billing_phone'];
|
||||
$national_number = preg_replace( '/[^0-9]/', '', $national_number );
|
||||
$national_number = substr( $national_number, 0, 14 );
|
||||
|
||||
$phone = new PhoneWithType(
|
||||
'HOME',
|
||||
new Phone( $national_number )
|
||||
);
|
||||
if ( null !== $national_number ) {
|
||||
$national_number = substr( $national_number, 0, 14 );
|
||||
|
||||
$phone = new PhoneWithType(
|
||||
'HOME',
|
||||
new Phone( $national_number )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return new Payer(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue