8000 minor #47649 Add a few more ??= (tigitz) · symfony/cache@3917396 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3917396

Browse files
committed
minor #47649 Add a few more ??= (tigitz)
This PR was merged into the 6.2 branch. Discussion ---------- Add a few more ??= | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - | License | MIT | Doc PR | - Continuation of symfony/symfony#47549 using rector with this config ```php <?php declare(strict_types=1); use Rector\Config\RectorConfig; use Rector\Php74\Rector\Assign\NullCoalescingOperatorRector; return static function (RectorConfig $rectorConfig): void { $rectorConfig->rule(NullCoalescingOperatorRector::class); }; ``` Commits ------- e681bd5021 Add a few more ??=
2 parents d840a9f + 01e01de commit 3917396

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Adapter/AbstractAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static function createSystemCache(string $namespace, int $defaultLifetime
9494
$opcache->setLogger($logger);
9595
}
9696

97-
if (!self::$apcuSupported = self::$apcuSupported ?? ApcuAdapter::isSupported()) {
97+
if (!self::$apcuSupported ??= ApcuAdapter::isSupported()) {
9898
return $opcache;
9999
}
100100

Adapter/CouchbaseBucketAdapter.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,17 @@ private static function getOptions(string $options): array
141141

142142
private static function initOptions(array $options): array
143143
{
144-
$options['username'] = $options['username'] ?? '';
145-
$options['password'] = $options['password'] ?? '';
146-
$options['operationTimeout'] = $options['operationTimeout'] ?? 0;
147-
$options['configTimeout'] = $options['configTimeout'] ?? 0;
148-
$options['configNodeTimeout'] = $options['configNodeTimeout'] ?? 0;
149-
$options['n1qlTimeout'] = $options['n1qlTimeout'] ?? 0;
150-
$options['httpTimeout'] = $options['httpTimeout'] ?? 0;
151-
$options['configDelay'] = $options['configDelay'] ?? 0;
152-
$options['htconfigIdleTimeout'] = $options['htconfigIdleTimeout'] ?? 0;
153-
$options['durabilityInterval'] = $options['durabilityInterval'] ?? 0;
154-
$options['durabilityTimeout'] = $options['durabilityTimeout'] ?? 0;
144+
$options['username'] ??= '';
145+
$options['password'] ??= '';
146+
$options['operationTimeout'] ??= 0;
147+
$options['configTimeout'] ??= 0;
148+
$options['configNodeTimeout'] ??= 0;
149+
$options['n1qlTimeout'] ??= 0;
150+
$options['httpTimeout'] ??= 0;
151+
$options['configDelay'] ??= 0;
152+
$options['htconfigIdleTimeout'] ??= 0;
153+
$options['durabilityInterval'] ??= 0;
154+
$options['durabilityTimeout'] ??= 0;
155155

156156
return $options;
157157
}

Adapter/PhpFilesAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class PhpFilesAdapter extends AbstractAdapter implements PruneableInterface
4646
public function __construct(string $namespace = '', int $defaultLifetime = 0, string $directory = null, bool $appendOnly = false)
4747
{
4848
$this->appendOnly = $appendOnly;
49-
self::$startTime = self::$startTime ?? $_SERVER['REQUEST_TIME'] ?? time();
49+
self::$startTime ??= $_SERVER['REQUEST_TIME'] ?? time();
5050
parent::__construct('', $defaultLifetime);
5151
$this->init($namespace, $directory);
5252
$this->includeHandler = static function ($type, $msg, $file, $line) {
@@ -56,7 +56,7 @@ public function __construct(string $namespace = '', int $defaultLifetime = 0, st
5656

5757
public static function isSupported()
5858
{
59-
self::$startTime = self::$startTime ?? $_SERVER['REQUEST_TIME'] ?? time();
59+
self::$startTime ??= $_SERVER['REQUEST_TIME'] ?? time();
6060

6161
return \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOL));
6262
}

0 commit comments

Comments
 (0)
0