From 67422293451aa24801303bc534e8042d25d6aed2 Mon Sep 17 00:00:00 2001 From: Narek Zakarian Date: Wed, 24 Aug 2022 16:51:56 +0400 Subject: [PATCH] Fix Psalm problems --- modules/ppcp-wc-gateway/connection-tab-settings.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-wc-gateway/connection-tab-settings.php b/modules/ppcp-wc-gateway/connection-tab-settings.php index 0c7cf6aef..481f3f313 100644 --- a/modules/ppcp-wc-gateway/connection-tab-settings.php +++ b/modules/ppcp-wc-gateway/connection-tab-settings.php @@ -422,8 +422,9 @@ return function ( ContainerInterface $container, array $fields ): array { 'default' => ( static function (): string { $site_url = get_site_url( get_current_blog_id() ); $hash = md5( $site_url ); - $letters = preg_replace( '~\d~', '', $hash ); - return $letters ? substr( $letters, 0, 6 ) . '-' : ''; + $letters = preg_replace( '~\d~', '', $hash ) ?? ''; + $prefix = substr( $letters, 0, 6 ); + return $prefix ? $prefix . '-' : ''; } )(), 'screens' => array( State::STATE_START,