Skip to content

Commit 04726ae

Browse files
Use ??= more
1 parent 30d8f86 commit 04726ae

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Languages.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ public static function alpha3CodeExists(string $language): bool
126126
return true;
127127
} catch (MissingResourceException) {
128128
static $cache;
129-
if (null === $cache) {
130-
$cache = array_flip(self::getAlpha3Codes());
131-
}
129+
$cache ??= array_flip(self::getAlpha3Codes());
132130

133131
return isset($cache[$language]);
134132
}

Util/IntlTestHelper.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class IntlTestHelper
3232
*/
3333
public static function requireIntl(TestCase $testCase, string $minimumIcuVersion = null)
3434
{
35-
if (null === $minimumIcuVersion) {
36-
$minimumIcuVersion = Intl::getIcuStubVersion();
37-
}
35+
$minimumIcuVersion ??= Intl::getIcuStubVersion();
3836

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

0 commit comments

Comments
 (0)