Skip to content

Commit

Permalink
Merge pull request #220 from Yoast/JRF/modernize-null-coalesce
Browse files Browse the repository at this point in the history
Modernize: use null coalesce
  • Loading branch information
jrfnl authored Dec 16, 2023
2 parents e333d2a + bc49785 commit d18c7f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/domain-dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down
2 changes: 1 addition & 1 deletion src/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand Down

0 comments on commit d18c7f1

Please sign in to comment.