Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"

steps:
- name: "Checkout"
Expand All @@ -43,7 +44,7 @@ jobs:
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Transform source code"
if: matrix.php-version != '7.4' && matrix.php-version != '8.0'
if: matrix.php-version != '7.4' && matrix.php-version != '8.0' && matrix.php-version != '8.1'
run: php bin/transform-source.php

- name: "Lint"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
operating-system: [ubuntu-latest, windows-latest]
script:
- "make phpstan"
Expand All @@ -50,7 +51,7 @@ jobs:
run: "composer require --dev phpunit/phpunit:^7.5.20 brianium/paratest:^4.0 --update-with-dependencies"

- name: "Transform source code"
if: matrix.php-version != '7.4' && matrix.php-version != '8.0'
if: matrix.php-version != '7.4' && matrix.php-version != '8.0' && matrix.php-version != '8.1'
run: php bin/transform-source.php

- name: "PHPStan"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
operating-system: [ ubuntu-latest, windows-latest ]
script:
- "make tests"
Expand All @@ -46,7 +47,7 @@ jobs:
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Transform source code"
if: matrix.php-version != '7.4' && matrix.php-version != '8.0'
if: matrix.php-version != '7.4' && matrix.php-version != '8.0' && matrix.php-version != '8.1'
run: php bin/transform-source.php

- name: "Tests"
Expand Down
2 changes: 1 addition & 1 deletion conf/config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ parametersSchema:
minimumNumberOfJobsPerProcess: int(),
buffer: int()
])
phpVersion: schema(anyOf(schema(int(), min(70100), max(80099))), nullable())
phpVersion: schema(anyOf(schema(int(), min(70100), max(80199))), nullable())
polluteScopeWithLoopInitialAssignments: bool()
polluteScopeWithAlwaysIterableForeach: bool()
polluteCatchScopeWithTryAssignments: bool()
Expand Down
2 changes: 1 addition & 1 deletion src/Php/PhpVersionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function create(): PhpVersion
$parts = explode('.', $this->composerPhpVersion);
$tmp = (int) $parts[0] * 10000 + (int) ($parts[1] ?? 0) * 100 + (int) ($parts[2] ?? 0);
$tmp = max($tmp, 70100);
$versionId = min($tmp, 80099);
$versionId = min($tmp, 80199);
}

if ($versionId === null) {
Expand Down
6 changes: 4 additions & 2 deletions tests/PHPStan/Analyser/NodeScopeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,11 @@ public function dataFileAsserts(): iterable
yield from $this->gatherAssertTypes(__DIR__ . '/data/throw-points/while.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/throw-points/try-catch.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/phpdoc-pseudotype-override.php');
require_once __DIR__ . '/data/phpdoc-pseudotype-namespace.php';

yield from $this->gatherAssertTypes(__DIR__ . '/data/phpdoc-pseudotype-namespace.php');
if (PHP_VERSION_ID < 80100) {
require_once __DIR__ . '/data/phpdoc-pseudotype-namespace.php';
yield from $this->gatherAssertTypes(__DIR__ . '/data/phpdoc-pseudotype-namespace.php');
}
yield from $this->gatherAssertTypes(__DIR__ . '/data/phpdoc-pseudotype-global.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/generic-traits.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-4423.php');
Expand Down
16 changes: 14 additions & 2 deletions tests/PHPStan/Php/PhpVersionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,27 @@ public function dataCreate(): array
[
null,
'8.1',
80099,
'8.0.99',
80100,
'8.1',
],
[
null,
'8.2',
80199,
'8.1.99',
],
[
null,
'8.0.95',
80095,
'8.0.95',
],
[
null,
'8.1.2',
80102,
'8.1.2',
],
];
}

Expand Down