diff --git a/phpstan-baseline.php b/phpstan-baseline.php index bd15482a2db5..9c5c98a51e45 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -10041,26 +10041,6 @@ 'count' => 2, 'path' => __DIR__ . '/tests/_support/Config/Filters.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/_support/Config/Registrar.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Tests\\\\Support\\\\Config\\\\Registrar\\:\\:Database\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/_support/Config/Registrar.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Method Tests\\\\Support\\\\Config\\\\Registrar\\:\\:Publisher\\(\\) return type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/_support/Config/Registrar.php', -]; -$ignoreErrors[] = [ - 'message' => '#^Property Tests\\\\Support\\\\Config\\\\Registrar\\:\\:\\$dbConfig type has no value type specified in iterable type array\\.$#', - 'count' => 1, - 'path' => __DIR__ . '/tests/_support/Config/Registrar.php', -]; $ignoreErrors[] = [ 'message' => '#^Variable \\$routes might not be defined\\.$#', 'count' => 5, diff --git a/tests/_support/Config/Registrar.php b/tests/_support/Config/Registrar.php index 8889021a2d00..b92c5e24bb16 100644 --- a/tests/_support/Config/Registrar.php +++ b/tests/_support/Config/Registrar.php @@ -23,9 +23,9 @@ class Registrar /** * DB config array for testing purposes. * - * @var array + * @var array|bool|int|string>> */ - protected static $dbConfig = [ + protected static array $dbConfig = [ 'MySQLi' => [ 'DSN' => '', 'hostname' => '127.0.0.1', @@ -126,15 +126,15 @@ class Registrar /** * Override database config * - * @return array + * @return array|bool|int|string> */ - public static function Database() + public static function Database(): array { $config = []; // Under GitHub Actions, we can set an ENV var named 'DB' // so that we can test against multiple databases. - if (($group = getenv('DB')) && ! empty(self::$dbConfig[$group])) { + if (($group = getenv('DB')) && isset(self::$dbConfig[$group])) { $config['tests'] = self::$dbConfig[$group]; } @@ -146,9 +146,9 @@ public static function Database() * * @see PublisherRestrictionsTest::testRegistrarsNotAllowed() * - * @return array + * @return array> */ - public static function Publisher() + public static function Publisher(): array { return [ 'restrictions' => [SUPPORTPATH => '*'],