Skip to content

Commit

Permalink
Use ??= more
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 2, 2022
1 parent 30d8f86 commit 04726ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ public static function alpha3CodeExists(string $language): bool
return true;
} catch (MissingResourceException) {
static $cache;
if (null === $cache) {
$cache = array_flip(self::getAlpha3Codes());
}
$cache ??= array_flip(self::getAlpha3Codes());

return isset($cache[$language]);
}
Expand Down
4 changes: 1 addition & 3 deletions Util/IntlTestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class IntlTestHelper
*/
public static function requireIntl(TestCase $testCase, string $minimumIcuVersion = null)
{
if (null === $minimumIcuVersion) {
$minimumIcuVersion = Intl::getIcuStubVersion();
}
$minimumIcuVersion ??= Intl::getIcuStubVersion();

// We only run tests if the version is *one specific version*.
// This condition is satisfied if
Expand Down

0 comments on commit 04726ae

Please sign in to comment.