diff --git a/system/Cache/Handlers/RedisHandler.php b/system/Cache/Handlers/RedisHandler.php index 6cd43506bdb5..80c21e8559e8 100644 --- a/system/Cache/Handlers/RedisHandler.php +++ b/system/Cache/Handlers/RedisHandler.php @@ -181,7 +181,7 @@ public function deleteMatching(string $pattern) $iterator = null; do { - /** @var false|list|Redis $keys */ + /** @var false|list $keys */ $keys = $this->redis->scan($iterator, $pattern); if (is_array($keys)) { diff --git a/system/Commands/Generators/MigrationGenerator.php b/system/Commands/Generators/MigrationGenerator.php index b7d7d585e945..b5e64ec1bce1 100644 --- a/system/Commands/Generators/MigrationGenerator.php +++ b/system/Commands/Generators/MigrationGenerator.php @@ -112,10 +112,7 @@ protected function prepare(string $class): string $data['DBGroup'] = is_string($DBGroup) ? $DBGroup : 'default'; $data['DBDriver'] = config(Database::class)->{$data['DBGroup']}['DBDriver']; - /** @var SessionConfig|null $session */ - $session = config(SessionConfig::class); - - $data['matchIP'] = $session->matchIP; + $data['matchIP'] = config(SessionConfig::class)->matchIP; } return $this->parseTemplate($class, [], [], $data); diff --git a/system/HTTP/CURLRequest.php b/system/HTTP/CURLRequest.php index 742da9f18d08..8a21d77262a0 100644 --- a/system/HTTP/CURLRequest.php +++ b/system/HTTP/CURLRequest.php @@ -125,9 +125,7 @@ public function __construct(App $config, URI $uri, ?ResponseInterface $response $this->baseURI = $uri->useRawQueryString(); $this->defaultOptions = $options; - /** @var ConfigCURLRequest|null $configCURLRequest */ - $configCURLRequest = config(ConfigCURLRequest::class); - $this->shareOptions = $configCURLRequest->shareOptions ?? true; + $this->shareOptions = config(ConfigCURLRequest::class)->shareOptions ?? true; $this->config = $this->defaultConfig; $this->parseOptions($options); diff --git a/system/I18n/TimeTrait.php b/system/I18n/TimeTrait.php index 5e908bef5c2e..42278c960c43 100644 --- a/system/I18n/TimeTrait.php +++ b/system/I18n/TimeTrait.php @@ -32,7 +32,7 @@ trait TimeTrait { /** - * @var DateTimeZone + * @var DateTimeZone|string */ protected $timezone; diff --git a/system/Test/ReflectionHelper.php b/system/Test/ReflectionHelper.php index 988fe949004c..47e85f4a8903 100644 --- a/system/Test/ReflectionHelper.php +++ b/system/Test/ReflectionHelper.php @@ -31,8 +31,7 @@ trait ReflectionHelper * @param object|string $obj object or class name * @param string $method method name * - * @return Closure - * @phpstan-return Closure(mixed ...$args): mixed + * @return Closure(mixed ...$args): mixed * * @throws ReflectionException */ diff --git a/tests/system/Commands/Utilities/ConfigCheckTest.php b/tests/system/Commands/Utilities/ConfigCheckTest.php index e49a8170ec08..dcd001b0c323 100644 --- a/tests/system/Commands/Utilities/ConfigCheckTest.php +++ b/tests/system/Commands/Utilities/ConfigCheckTest.php @@ -89,7 +89,9 @@ public function testCommandConfigCheckNonexistentClass(): void public function testConfigCheckWithKintEnabledUsesKintD(): void { - /** @var Closure(object): string $command */ + /** + * @var Closure(mixed...): string + */ $command = $this->getPrivateMethodInvoker( new ConfigCheck(service('logger'), service('commands')), 'getKintD', @@ -105,7 +107,9 @@ public function testConfigCheckWithKintEnabledUsesKintD(): void public function testConfigCheckWithKintDisabledUsesVarDump(): void { - /** @var Closure(object): string $command */ + /** + * @var Closure(mixed...): string + */ $command = $this->getPrivateMethodInvoker( new ConfigCheck(service('logger'), service('commands')), 'getVarDump', diff --git a/utils/phpstan-baseline/varTag.type.neon b/utils/phpstan-baseline/varTag.type.neon index 8edeb6f38113..4be1089ace00 100644 --- a/utils/phpstan-baseline/varTag.type.neon +++ b/utils/phpstan-baseline/varTag.type.neon @@ -1,37 +1,7 @@ -# total 9 errors +# total 2 errors parameters: ignoreErrors: - - - message: '#^PHPDoc tag @var with type list\\|Redis\|false is not subtype of type array\\|false\.$#' - count: 1 - path: ../../system/Cache/Handlers/RedisHandler.php - - - - message: '#^PHPDoc tag @var with type Config\\Session\|null is not subtype of type Config\\Session\.$#' - count: 1 - path: ../../system/Commands/Generators/MigrationGenerator.php - - - - message: '#^PHPDoc tag @var with type Config\\CURLRequest\|null is not subtype of type Config\\CURLRequest\.$#' - count: 1 - path: ../../system/HTTP/CURLRequest.php - - - - message: '#^PHPDoc tag @var with type string is not subtype of type DateTimeZone\.$#' - count: 1 - path: ../../system/I18n/Time.php - - - - message: '#^PHPDoc tag @var with type string is not subtype of type DateTimeZone\.$#' - count: 1 - path: ../../system/I18n/TimeLegacy.php - - - - message: '#^PHPDoc tag @var with type Closure\(object\)\: string is not subtype of type Closure\(mixed \.\.\.\)\: mixed\.$#' - count: 2 - path: ../../tests/system/Commands/Utilities/ConfigCheckTest.php - - message: '#^PHPDoc tag @var with type Tests\\Support\\Entity\\UserWithCasts is not subtype of type list\\|null\.$#' count: 1