From b1ea91320fc5925d606e706fc8ebb8b2b3a0fc9a Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Wed, 30 Oct 2024 15:25:25 +0100 Subject: [PATCH] Mitigate erronous complaint of phpstan phpstan complains that `assertIsArray($config)` will always fail because it doesn't know about the side effects of `require`ing the default config. --- tests/Framework/ConfigTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Framework/ConfigTest.php b/tests/Framework/ConfigTest.php index 2fcee679182..ca551507709 100644 --- a/tests/Framework/ConfigTest.php +++ b/tests/Framework/ConfigTest.php @@ -100,7 +100,7 @@ public function test_parse_env() // Test if values in defaults.inc.php and values in rcube_config::DEFAULTS match public function test_defaults_values(): void { - // Initialize the variable to make the static analysis happy. + // Initialize the variable to avoid warnings. $config = null; // Load the values from defaults.inc.php manually (we don't want to // test the whole loading mechanics of `rcube_config` here). @@ -108,7 +108,7 @@ public function test_defaults_values(): void require realpath(RCUBE_INSTALL_PATH . 'config/defaults.inc.php'); ob_end_clean(); - $this->assertIsArray($config); + $this->assertIsArray($config); // @phpstan-ignore-line foreach (\rcube_config::DEFAULTS as $name => $hardcoded_value) { $this->assertSame($hardcoded_value, $config[$name], "The value for '{$name}' in defaults.inc.php does not match the hardcoded default in rcube_config!");