Skip to content

Commit

Permalink
Fix return values
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmx-dev committed Dec 5, 2024
1 parent d15da62 commit 71e31f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion includes/class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -4231,7 +4231,7 @@ public function reset_upe_appearance_ajax() {
* Get the correct appearance transients for the given location.
*
* @param string $elements_location The location of the payment element.
* @return string|null[]
* @return (string|null)[]
*/
private function get_appearance_transients( $elements_location ) {
$appearance_transient = [
Expand Down
8 changes: 4 additions & 4 deletions includes/class-wc-payments-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1032,9 +1032,9 @@ public static function force_disconnected_enabled(): bool {
* Gets the appearance value from the transient or the persistent option.
*
* @param string $appearance_transient The transient where the appearance is stored.
* @return array|null The appearance value or null if it's not set.
* @return array|string|false The appearance value or false if it's not set.
*/
public static function get_appearance_value( $appearance_transient ) {
public static function get_appearance_value( string $appearance_transient ) {
$persistent_appearance = get_option( $appearance_transient );
if ( $persistent_appearance ) {
return $persistent_appearance;
Expand Down Expand Up @@ -1396,7 +1396,7 @@ public static function is_store_api_request(): bool {
*
* @param string $location The theme location.
* @param string $context The theme location to fall back to if both transients are set.
* @return string
* @return string|null
*/
public static function get_active_upe_theme_transient_for_location( string $location = 'checkout', string $context = 'blocks' ) {
$themes = \WC_Payment_Gateway_WCPay::APPEARANCE_THEME_TRANSIENTS;
Expand Down Expand Up @@ -1435,7 +1435,7 @@ public static function get_active_upe_theme_transient_for_location( string $loca
}

// If $active_theme is still false, we don't have any theme set in the transients, so we fallback to 'stripe'.
if ( $active_theme ) {
if ( $active_theme && is_string( $active_theme ) ) {
return $active_theme;
}

Expand Down

0 comments on commit 71e31f8

Please sign in to comment.