Skip to content

Commit 67a4ebb

Browse files
committed
Add a few more ??=
1 parent bb7bc61 commit 67a4ebb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Caster/MemcachedCaster.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $
3737

3838
private static function getNonDefaultOptions(\Memcached $c): array
3939
{
40-
self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions();
41-
self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
40+
self::$defaultOptions ??= self::discoverDefaultOptions();
41+
self::$optionConstants ??= self::getOptionConstants();
4242

4343
$nonDefaultOptions = [];
4444
foreach (self::$optionConstants as $constantKey => $value) {
@@ -56,7 +56,7 @@ private static function discoverDefaultOptions(): array
5656
$defaultMemcached->addServer('127.0.0.1', 11211);
5757

5858
$defaultOptions = [];
59-
self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
59+
self::$optionConstants ??= self::getOptionConstants();
6060

6161
foreach (self::$optionConstants as $constantKey => $value) {
6262
$defaultOptions[$constantKey] = $defaultMemcached->getOption($value);

0 commit comments

Comments
 (0)