Skip to content

Commit

Permalink
Raise minimum PHP version up to 8.1 (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov authored Nov 26, 2024
1 parent e9805e2 commit 36c31b9
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.1']
['8.3']
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
- ubuntu-latest

php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand All @@ -65,7 +64,7 @@ jobs:
run: vendor/bin/phpunit --testsuite=Migration --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
if: matrix.php == '8.3'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/composer-require-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0', '8.1', '8.2', '8.3']
['8.1', '8.2', '8.3']
3 changes: 1 addition & 2 deletions .github/workflows/mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- ubuntu-latest

php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand Down Expand Up @@ -88,7 +87,7 @@ jobs:
run: vendor/bin/phpunit --testsuite=Mysql --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
if: matrix.php == '8.3'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- ubuntu-latest

php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand Down Expand Up @@ -92,7 +91,7 @@ jobs:
run: vendor/bin/phpunit --testsuite=Mssql --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
if: matrix.php == '8.3'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- ubuntu-latest

php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand Down Expand Up @@ -83,7 +82,7 @@ jobs:
run: vendor/bin/phpunit --testsuite=Mysql --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
if: matrix.php == '8.3'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- ubuntu-latest

php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand Down Expand Up @@ -87,7 +86,7 @@ jobs:
run: vendor/bin/phpunit --testsuite Oracle --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
if: matrix.php == '8.3'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- ubuntu-latest

php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand Down Expand Up @@ -89,7 +88,7 @@ jobs:
run: vendor/bin/phpunit --testsuite=Pgsql --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
if: matrix.php == '8.3'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
- windows-latest

php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand Down Expand Up @@ -70,7 +69,7 @@ jobs:
run: vendor/bin/phpunit --testsuite=Sqlite --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
if: matrix.php == '8.3'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
- ubuntu-latest

php:
- '8.0'
- '8.1'
- '8.2'
- '8.3'
Expand Down Expand Up @@ -67,10 +66,5 @@ jobs:
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Static analysis PHP 8.0
if: matrix.php == '8.0'
run: vendor/bin/psalm --shepherd --config=psalm-8.0.xml --stats --output-format=checkstyle --php-version=${{ matrix.php }} | cs2pr --graceful-warnings --colorize

- name: Static analysis PHP not 8.0
if: matrix.php != '8.0'
- name: Static analysis
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle --php-version=${{ matrix.php }} | cs2pr --graceful-warnings --colorize
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## 1.1.1 under development

- Enh #268: Don't use Yii DB deprecated methods in `Migrator` (@BaBL86, @vjik)
- Enh #268: Don't use Yii DB deprecated methods in `Migrator` (@BaBL86, @vjik)
- Enh #272: Raise minimum PHP version to `^8.1` with minor refactoring (@Tigrov)

## 1.1.0 December 24, 2023

Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"ext-filter": "*",
"symfony/console": "^6.0|^7.0",
"yiisoft/db": "^1.3",
"yiisoft/injector": "^1.2"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.4",
"phpunit/phpunit": "^9.6|^10.2",
"phpunit/phpunit": "^10.5",
"rector/rector": "^1.0",
"roave/infection-static-analysis-plugin": "^1.25|^1.32",
"roave/infection-static-analysis-plugin": "^1.35",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.30|^5.25",
"vimeo/psalm": "^5.25",
"yiisoft/db-sqlite": "^1.1",
"yiisoft/di": "^1.2",
"yiisoft/files": "^1.0|^2.0",
"yiisoft/files": "^2.0",
"yiisoft/test-support": "^3.0",
"yiisoft/yii-console": "^1.0|^2.0"
"yiisoft/yii-console": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
22 changes: 0 additions & 22 deletions psalm-8.0.xml

This file was deleted.

8 changes: 5 additions & 3 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
Expand All @@ -19,11 +20,12 @@

// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
LevelSetList::UP_TO_PHP_81,
]);

$rectorConfig->skip([
ClosureToArrowFunctionRector::class,
NullToStrictStringFuncCallArgRector::class,
ReadOnlyPropertyRector::class,
RemoveExtraParametersRector::class => [__DIR__ . '/src/Service/Generate/PhpRenderer.php'],
]);

Expand Down
4 changes: 2 additions & 2 deletions src/Service/MigrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public function makeMigration(string $class): MigrationInterface
public function makeMigrations(array $classes): array
{
return array_map(
[$this, 'makeMigration'],
$this->makeMigration(...),
$classes
);
}
Expand Down Expand Up @@ -301,7 +301,7 @@ public function makeRevertibleMigration(string $class): RevertibleMigrationInter
public function makeRevertibleMigrations(array $classes): array
{
return array_map(
[$this, 'makeRevertibleMigration'],
$this->makeRevertibleMigration(...),
$classes
);
}
Expand Down

0 comments on commit 36c31b9

Please sign in to comment.