From bc4978509cc96c20eefe6e5a51901dcaab1057ec Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 30 Nov 2023 17:15:47 +0100 Subject: [PATCH] Modernize: use null coalesce --- src/domain-dropdown.php | 2 +- src/option.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain-dropdown.php b/src/domain-dropdown.php index 41d9499..0342531 100644 --- a/src/domain-dropdown.php +++ b/src/domain-dropdown.php @@ -130,7 +130,7 @@ private function replace_domain( $domain, $url, $headers ) { } if ( $url_host === 'my.yoast.com' ) { - $host = isset( $headers['Host'] ) ? $headers['Host'] : $new_host; + $host = ( $headers['Host'] ?? $new_host ); $url = \str_replace( 'https://' . $url_host, $domain, $url ); } diff --git a/src/option.php b/src/option.php index 8066ac4..119b1f8 100644 --- a/src/option.php +++ b/src/option.php @@ -39,7 +39,7 @@ public function __construct( $option_name = 'yoast_test_helper' ) { * @return mixed|null The content of the retrieved key. */ public function get( $key ) { - return isset( $this->options[ $key ] ) ? $this->options[ $key ] : null; + return ( $this->options[ $key ] ?? null ); } /**