Skip to content

Commit 2e408f6

Browse files
authored
chore: remove server superglobal support (#616)
1 parent 3e63576 commit 2e408f6

3 files changed

Lines changed: 2 additions & 16 deletions

File tree

src/CredentialsLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,6 @@ public function getUniverseDomain(): string
295295

296296
private static function getEnv(string $env): mixed
297297
{
298-
return getenv($env) ?: $_SERVER[$env] ?? $_ENV[$env] ?? null;
298+
return getenv($env) ?: $_ENV[$env] ?? null;
299299
}
300300
}

tests/CredentialsLoaderTest.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,6 @@ public function testLoadJsonFromGetEnv(): void
168168
$this->assertEquals('getenv', $json['type']);
169169
}
170170

171-
/**
172-
* @runInSeparateProcess
173-
*/
174-
public function testLoadJsonFromServer(): void
175-
{
176-
$_SERVER[CredentialsLoader::ENV_VAR] = __DIR__ . '/fixtures7/server.json';
177-
178-
$json = CredentialsLoader::fromEnv();
179-
180-
$this->assertArrayHasKey('type', $json);
181-
$this->assertEquals('server', $json['type']);
182-
}
183-
184171
/**
185172
* @runInSeparateProcess
186173
*/
@@ -199,7 +186,7 @@ public function testLoadJsonFromEnv(): void
199186
*/
200187
public function testLoadJsonFromGetEnvBackwardsCompatibility(): void
201188
{
202-
$_SERVER[CredentialsLoader::ENV_VAR] = __DIR__ . '/fixtures7/server.json';
189+
$_ENV[CredentialsLoader::ENV_VAR] = __DIR__ . '/fixtures7/env.json';
203190
putenv(CredentialsLoader::ENV_VAR . '=' . __DIR__ . '/fixtures7/getenv.json');
204191

205192
$json = CredentialsLoader::fromEnv();

tests/fixtures7/server.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)