Skip to content

Commit 647fc09

Browse files
committedMay 22, 2025
Add test
1 parent 6bc4f2c commit 647fc09

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎tests/PHPStan/Analyser/data/getenv-php74.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
class Foo
88
{
99

10-
public function test()
10+
public function test(string|null $stringOrNull, mixed $mixed)
1111
{
1212
assertType('string|false', getenv(null));
1313
assertType('array<string, string>', getenv());
1414
assertType('string|false', getenv('foo'));
15+
16+
assertType('string|false', getenv($stringOrNull));
17+
assertType('string|false', getenv($mixed));
1518
}
1619

1720
}

‎tests/PHPStan/Analyser/data/getenv-php80.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
class Foo
88
{
99

10-
public function test()
10+
public function test(string|null $stringOrNull, mixed $mixed)
1111
{
1212
assertType('array<string, string>', getenv(null));
1313
assertType('array<string, string>', getenv());
1414
assertType('string|false', getenv('foo'));
15+
16+
assertType('array<string, string>|string|false', getenv($stringOrNull));
17+
assertType('array<string, string>|string|false', getenv($mixed));
1518
}
1619

1720
}

0 commit comments

Comments
 (0)