Skip to content

Commit

Permalink
Rewrite without ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Jul 4, 2022
1 parent d1b33be commit 39e6cd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MakeJsonCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ protected function make_json( $source_file, $destination, $map ) {

$domain = $translations->getDomain();

$base_file_name_with_domain = $domain && 0 !== strpos( $base_file_name, $domain ) ?
"$domain-$base_file_name" :
$base_file_name;
if ( $domain && 0 !== strpos( $base_file_name, $domain ) ) {
$base_file_name = "$domain-$base_file_name";
}

foreach ( $translations as $translation ) {
/** @var Translation $translation */
Expand Down Expand Up @@ -291,7 +291,7 @@ static function ( $reference ) {
}
}

$result += $this->build_json_files( $mapping, $base_file_name_with_domain, $destination );
$result += $this->build_json_files( $mapping, $base_file_name, $destination );

return $result;
}
Expand Down

0 comments on commit 39e6cd9

Please sign in to comment.