Skip to content

Commit b221a56

Browse files
committed
chore: fix PHPStan null coalescing warnings for Config properties
1 parent 196e26d commit b221a56

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

system/Database/BaseConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ protected function getSessionTimezone(): ?string
21292129
// Auto-sync with app timezone
21302130
if ($this->timezone === true) {
21312131
$appConfig = config('App');
2132-
$timezone = $appConfig->appTimezone ?? 'UTC';
2132+
$timezone = $appConfig->appTimezone;
21332133
} else {
21342134
// Use specific timezone from config
21352135
$timezone = $this->timezone;

system/Log/Logger.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ public function __construct($config, bool $debug = CI_DEBUG)
181181
$this->logCache = [];
182182
}
183183

184-
$this->logGlobalContext = $config->logGlobalContext ?? $this->logGlobalContext;
185-
$this->logContext = $config->logContext ?? $this->logContext;
186-
$this->logContextTrace = $config->logContextTrace ?? $this->logContextTrace;
187-
$this->logContextUsedKeys = $config->logContextUsedKeys ?? $this->logContextUsedKeys;
184+
$this->logGlobalContext = $config->logGlobalContext ?? $this->logGlobalContext; // @phpstan-ignore nullCoalesce.property
185+
$this->logContext = $config->logContext ?? $this->logContext; // @phpstan-ignore nullCoalesce.property
186+
$this->logContextTrace = $config->logContextTrace ?? $this->logContextTrace; // @phpstan-ignore nullCoalesce.property
187+
$this->logContextUsedKeys = $config->logContextUsedKeys ?? $this->logContextUsedKeys; // @phpstan-ignore nullCoalesce.property
188188
}
189189

190190
/**

tests/system/Database/Live/ConnectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function testTimezoneAutoSyncWithAppTimezone(): void
186186
$timezone = $this->getDatabaseTimezone($db, $driver);
187187

188188
$appConfig = config('App');
189-
$appTimezone = $appConfig->appTimezone ?? 'UTC';
189+
$appTimezone = $appConfig->appTimezone;
190190
$expectedOffset = $this->getPrivateMethodInvoker($db, 'convertTimezoneToOffset')($appTimezone);
191191

192192
$this->assertSame($expectedOffset, $timezone);

0 commit comments

Comments
 (0)