diff --git a/src/Helpers/TelemetryHelper.php b/src/Helpers/TelemetryHelper.php index 8512f86b3..141479c3d 100644 --- a/src/Helpers/TelemetryHelper.php +++ b/src/Helpers/TelemetryHelper.php @@ -107,7 +107,13 @@ public function initializeAmplitude(): void { } } - public static function normalizeAhEnv($ah_env): string { + /** + * @param string $ah_env + * Environment name from AH_ENV. + * @return string + * Normalized environment name. + */ + public static function normalizeAhEnv(string $ah_env): string { if (AcquiaDrupalEnvironmentDetector::isAhProdEnv($ah_env)) { return 'prod'; } diff --git a/tests/phpunit/src/Misc/TelemetryHelperTest.php b/tests/phpunit/src/Misc/TelemetryHelperTest.php index 14c473fba..611a9ca1a 100644 --- a/tests/phpunit/src/Misc/TelemetryHelperTest.php +++ b/tests/phpunit/src/Misc/TelemetryHelperTest.php @@ -67,6 +67,11 @@ public function testGetEnvironmentProviderWithoutAnyEnvSet(): void { // Expect null since no provider environment variables are set. $this->assertNull(TelemetryHelper::getEnvironmentProvider()); } + + /** + * @return mixed[] + * The data provider. + */ public function providerTestAhEnvNormalization(): array { return [ ['prod', 'prod'], @@ -81,8 +86,12 @@ public function providerTestAhEnvNormalization(): array { /** * @dataProvider providerTestAhEnvNormalization + * @param string $ah_env + * The Acquia hosting environment. + * @param string $expected + * The expected normalized environment. */ - public function testAhEnvNormalization($ah_env, $expected) { + public function testAhEnvNormalization(string $ah_env, string $expected): void { $normalized_ah_env = TelemetryHelper::normalizeAhEnv($ah_env); $this->assertEquals($expected, $normalized_ah_env); }