Skip to content

Commit 9b690af

Browse files
committed
refactor: use assert() instead of @var
To fix both psalm and phpstan errors
1 parent 84e40b4 commit 9b690af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

system/Config/Services.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,9 @@ public static function image(?string $handler = null, ?Images $config = null, bo
331331
return static::getSharedInstance('image', $handler, $config);
332332
}
333333

334-
/** @var Images $config */
335334
$config ??= config('Images');
335+
assert($config instanceof Images);
336+
336337
$handler = $handler ?: $config->defaultHandler;
337338
$class = $config->handlers[$handler];
338339

@@ -639,8 +640,9 @@ public static function session(?App $config = null, bool $getShared = true)
639640
return static::getSharedInstance('session', $config);
640641
}
641642

642-
/** @var App $config */
643643
$config ??= config('App');
644+
assert($config instanceof App);
645+
644646
$logger = AppServices::logger();
645647

646648
$driverName = $config->sessionDriver;

0 commit comments

Comments
 (0)