Skip to content

Commit d18c7f1

Browse files
authored
Merge pull request #220 from Yoast/JRF/modernize-null-coalesce
Modernize: use null coalesce
2 parents e333d2a + bc49785 commit d18c7f1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/domain-dropdown.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private function replace_domain( $domain, $url, $headers ) {
130130
}
131131

132132
if ( $url_host === 'my.yoast.com' ) {
133-
$host = isset( $headers['Host'] ) ? $headers['Host'] : $new_host;
133+
$host = ( $headers['Host'] ?? $new_host );
134134
$url = \str_replace( 'https://' . $url_host, $domain, $url );
135135
}
136136

src/option.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct( $option_name = 'yoast_test_helper' ) {
3939
* @return mixed|null The content of the retrieved key.
4040
*/
4141
public function get( $key ) {
42-
return isset( $this->options[ $key ] ) ? $this->options[ $key ] : null;
42+
return ( $this->options[ $key ] ?? null );
4343
}
4444

4545
/**

0 commit comments

Comments
 (0)