Skip to content

Commit 982cf73

Browse files
committed
Added regression test
1 parent 24697cb commit 982cf73

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ jobs:
391391
cd e2e/composer-version-config
392392
composer install
393393
../../bin/phpstan analyze test.php --level=0
394+
- script: |
395+
cd e2e/composer-version-named-args
396+
../../bin/phpstan analyze test.php --level=0
394397
395398
steps:
396399
- name: "Checkout"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace NamedAttributesPhpversion;
4+
5+
use Exception;
6+
use function PHPStan\debugScope;
7+
use function PHPStan\dumpType;
8+
use function PHPStan\Testing\assertType;
9+
10+
class HelloWorld
11+
{
12+
/** @return mixed[] */
13+
public function sayHello(): array|null
14+
{
15+
if(PHP_VERSION_ID >= 80400) {
16+
} else {
17+
}
18+
return [
19+
new Exception(previous: new Exception()),
20+
];
21+
}
22+
}
23+
24+
class HelloWorld2
25+
{
26+
/** @return mixed[] */
27+
public function sayHello(): array|null
28+
{
29+
return [
30+
PHP_VERSION_ID >= 80400 ? 1 : 0,
31+
new Exception(previous: new Exception()),
32+
];
33+
}
34+
}

0 commit comments

Comments
 (0)