Skip to content

Commit 1c565b5

Browse files
committed
Revert "Fix "Named arguments are supported only on PHP 8.0 and later." false positive"
This reverts commit c3f27ec.
1 parent c3f27ec commit 1c565b5

File tree

4 files changed

+2
-44
lines changed

4 files changed

+2
-44
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,6 @@ 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
397394
398395
steps:
399396
- name: "Checkout"

e2e/composer-version-named-args/test.php

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/Analyser/ConstantResolver.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
final class ConstantResolver
3535
{
3636

37-
public const PHP_MIN_ANALYZABLE_VERSION_ID = 50207;
38-
3937
/** @var array<string, true> */
4038
private array $currentlyResolving = [];
4139

@@ -143,7 +141,7 @@ public function resolvePredefinedConstant(string $resolvedConstantName): ?Type
143141
return $this->createInteger($minRelease, $maxRelease);
144142
}
145143
if ($resolvedConstantName === 'PHP_VERSION_ID') {
146-
$minVersion = self::PHP_MIN_ANALYZABLE_VERSION_ID;
144+
$minVersion = 50207;
147145
$maxVersion = null;
148146
if ($minPhpVersion !== null) {
149147
$minVersion = max($minVersion, $minPhpVersion->getVersionId());

src/Analyser/MutatingScope.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
use PHPStan\Parser\NewAssignedToPropertyVisitor;
5353
use PHPStan\Parser\Parser;
5454
use PHPStan\Php\PhpVersion;
55-
use PHPStan\Php\PhpVersionFactory;
5655
use PHPStan\Php\PhpVersions;
5756
use PHPStan\PhpDoc\Tag\TemplateTag;
5857
use PHPStan\Reflection\Assertions;
@@ -6236,10 +6235,8 @@ public function getIterableValueType(Type $iteratee): Type
62366235

62376236
public function getPhpVersion(): PhpVersions
62386237
{
6239-
$overallPhpVersionRange = IntegerRangeType::fromInterval(ConstantResolver::PHP_MIN_ANALYZABLE_VERSION_ID, PhpVersionFactory::MAX_PHP_VERSION);
6240-
62416238
$constType = $this->getGlobalConstantType(new Name('PHP_VERSION_ID'));
6242-
if ($constType !== null && !$constType->equals($overallPhpVersionRange)) {
6239+
if ($constType !== null) {
62436240
return new PhpVersions($constType);
62446241
}
62456242

0 commit comments

Comments
 (0)