Skip to content

Commit f0d1706

Browse files
committed
refactor: Upgrade PHP version to 8.2 in configuration files
- Updated php-version from 8.1 to 8.2 in php-cs-fixer.yml, phpstan.yml, rector.yml, and tests.yml. - Adjusted PHP version requirement in composer.json and README.md to reflect the upgrade. - Ensured compatibility with the latest PHP features and improvements. Signed-off-by: guanguans <[email protected]>
1 parent cd60fab commit f0d1706

File tree

14 files changed

+70
-106
lines changed

14 files changed

+70
-106
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup PHP
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: '8.1'
22+
php-version: '8.2'
2323
coverage: none
2424
env:
2525
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup PHP
2424
uses: shivammathur/setup-php@v2
2525
with:
26-
php-version: '8.1'
26+
php-version: '8.2'
2727
coverage: none
2828
env:
2929
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup PHP
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: '8.1'
22+
php-version: '8.2'
2323
coverage: none
2424
env:
2525
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [windows-latest, macos-latest, ubuntu-latest]
18-
php: [8.1, 8.5]
18+
php: [8.2, 8.5]
1919
dependency-version: [prefer-stable]
2020

2121
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

.php-cs-fixer.dist.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
use Ergebnis\PhpCsFixer\Config\Factory;
2020
use Ergebnis\PhpCsFixer\Config\Fixers;
2121
use Ergebnis\PhpCsFixer\Config\Rules;
22-
use Ergebnis\PhpCsFixer\Config\RuleSet\Php81;
22+
use Ergebnis\PhpCsFixer\Config\RuleSet\Php82;
2323
use PhpCsFixer\Finder;
2424

2525
require __DIR__.'/vendor/autoload.php';
2626

27-
return Factory::fromRuleSet(Php81::create()
27+
return Factory::fromRuleSet(Php82::create()
2828
->withHeader(
2929
(static function (): string {
3030
$mit = MIT::text(

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
## Requirement
1515

16-
* PHP >= 8.1
16+
* PHP >= 8.2
1717

1818
## Used in the framework
1919

composer-bump

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ $statusCode = (new SingleCommandApplication)
5858

5959
exit($statusCode);
6060

61-
final class ComposerBump
61+
final readonly class ComposerBump
6262
{
63-
private readonly string $composerJsonPath;
64-
private readonly string $composer;
65-
private readonly string $highestComposer;
63+
private string $composerJsonPath;
64+
private string $composer;
65+
private string $highestComposer;
6666

6767
/** @var list<string> */
68-
private readonly array $exceptPackages;
68+
private array $exceptPackages;
6969

7070
/** @var list<string> */
71-
private readonly array $exceptVersions;
71+
private array $exceptVersions;
7272

7373
/**
7474
* @noinspection ParameterDefaultsNullInspection
@@ -80,7 +80,7 @@ final class ComposerBump
8080
?string $composerBinary = null,
8181
array $exceptPackages = [],
8282
array $exceptVersions = [],
83-
private readonly SymfonyStyle $symfonyStyle = new SymfonyStyle(
83+
private SymfonyStyle $symfonyStyle = new SymfonyStyle(
8484
new ArgvInput,
8585
new ConsoleOutput
8686
)
@@ -217,7 +217,7 @@ final class ComposerBump
217217
),
218218
$lowestArrayVersion[0] < $highestArrayVersion[0] => array_map(
219219
static fn (string $major): string => "^$major.0",
220-
range($lowestArrayVersion[0] + 1, $highestArrayVersion[0])
220+
range((int) $lowestArrayVersion[0] + 1, $highestArrayVersion[0])
221221
),
222222
default => []
223223
},

composer-dependency-analyser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
__DIR__.'/tests/',
2828
])
2929
->ignoreUnknownClasses([
30-
SensitiveParameter::class,
30+
// SensitiveParameter::class,
3131
])
3232
/** @see \ShipMonk\ComposerDependencyAnalyser\Analyser::CORE_EXTENSIONS */
3333
->ignoreErrorsOnExtensions(

composer.json

Lines changed: 46 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
}
4141
],
4242
"require": {
43-
"php": ">=8.1",
44-
"symfony/process": "^6.4 || ^7.0 || ^8.0"
43+
"php": ">=8.2",
44+
"symfony/process": "^7.4 || ^8.0"
4545
},
4646
"require-dev": {
4747
"adamwojs/php-cs-fixer-phpdoc-force-fqcn": "^2.0",
@@ -51,45 +51,61 @@
5151
"ergebnis/composer-normalize": "^2.50",
5252
"ergebnis/license": "^2.7",
5353
"ergebnis/php-cs-fixer-config": "^6.60",
54-
"ergebnis/rector-rules": "^1.14",
54+
"ergebnis/phpstan-rules": "^2.13",
55+
"ergebnis/rector-rules": "^1.15",
5556
"fakerphp/faker": "^1.24",
57+
"guanguans/monorepo-builder-worker": "^3.1",
5658
"guanguans/php-cs-fixer-custom-fixers": "^1.2",
59+
"guanguans/phpstan-rules": "^1.1",
5760
"guanguans/rector-rules": "^1.7",
58-
"illuminate/support": "^10.49 || ^11.0 || ^12.0 || ^13.0",
61+
"illuminate/support": "^12.55 || ^13.0",
5962
"jbelien/phpstan-sarif-formatter": "^1.2",
6063
"mockery/mockery": "^1.6",
61-
"nette/utils": "^4.0",
62-
"pestphp/pest": "^2.36 || ^3.0 || ^4.0",
63-
"pestphp/pest-plugin-arch": "^2.7 || ^3.0 || ^4.0",
64-
"pestphp/pest-plugin-profanity": "^1.7 || ^2.0 || ^3.0 || ^4.0",
64+
"mrpunyapal/peststan": "^0.1",
65+
"mrpunyapal/rector-pest": "^0.2",
66+
"nette/utils": "^4.1",
67+
"nicksdot/phpstan-phpstorm-error-identifiers": "^0.3",
68+
"peckphp/peck": "^0.2",
69+
"pestphp/pest": "^3.8 || ^4.0",
70+
"pestphp/pest-plugin-arch": "^3.1 || ^4.0",
71+
"pestphp/pest-plugin-profanity": "^3.23 || ^4.0",
6572
"php-mock/php-mock-phpunit": "^2.15",
66-
"phpbench/phpbench": "^1.4",
73+
"phpbench/phpbench": "^1.6",
6774
"phpstan/extension-installer": "^1.4",
68-
"phpstan/phpstan": "^2.1",
6975
"phpstan/phpstan-deprecation-rules": "^2.0",
7076
"phpstan/phpstan-mockery": "^2.0",
7177
"phpstan/phpstan-strict-rules": "^2.0",
7278
"phpstan/phpstan-webmozart-assert": "^2.0",
73-
"phpunit/phpunit": "^10.5 || ^11.0 || ^12.0 || ^13.0",
79+
"phpunit/phpunit": "^11.5 || ^12.0 || ^13.0",
7480
"povils/phpmnd": "^3.6",
81+
"rector/argtyper": "^0.6",
7582
"rector/jack": "^0.5",
76-
"rector/rector": "^2.3",
7783
"rector/swiss-knife": "^2.3",
7884
"rector/type-perfect": "^2.1",
85+
"roave/backward-compatibility-check": "^8.14",
86+
"roave/no-floaters": "^1.13",
7987
"shipmonk/composer-dependency-analyser": "^1.8",
8088
"shipmonk/dead-code-detector": "^0.15",
8189
"shipmonk/name-collision-detector": "^2.1",
8290
"shipmonk/phpstan-baseline-per-identifier": "^2.3",
91+
"shipmonk/phpstan-rules": "^4.3",
92+
"sidz/phpstan-rules": "^0.5",
8393
"spatie/invade": "^2.1",
8494
"spatie/pest-plugin-snapshots": "^2.3",
8595
"spaze/phpstan-disallowed-calls": "^4.9",
96+
"staabm/annotate-pull-request-from-checkstyle": "^1.8",
8697
"staabm/phpstan-todo-by": "^0.3",
98+
"staabm/side-effects-detector": "^1.0",
8799
"symfony/thanks": "^1.4",
88-
"symfony/var-dumper": "^6.4 || ^7.0 || ^8.0",
100+
"symfony/var-dumper": "^7.4 || ^8.0",
101+
"symplify/coding-standard": "^13.0",
102+
"symplify/easy-coding-standard": "^13.0",
89103
"symplify/phpstan-rules": "^14.9",
90104
"tomasvotruba/class-leak": "^2.1",
91105
"tomasvotruba/cognitive-complexity": "^1.0",
106+
"tomasvotruba/ctor": "^2.2",
92107
"tomasvotruba/type-coverage": "^2.1",
108+
"tomasvotruba/unused-public": "^2.2",
93109
"yamadashy/phpstan-friendly-formatter": "^1.4"
94110
},
95111
"suggest": {
@@ -137,7 +153,7 @@
137153
"target-directory": "vendor-bin"
138154
},
139155
"branch-alias": {
140-
"dev-master": "7.x-dev"
156+
"dev-master": "8.x-dev"
141157
},
142158
"composer-normalize": {
143159
"indent-size": 4,
@@ -165,7 +181,7 @@
165181
"actionlint": "actionlint -ignore=SC2035 -ignore=SC2086 -color -oneline -verbose",
166182
"argtyper": "@php vendor/bin/argtyper --ansi -vv",
167183
"argtyper:add-types": "@argtyper add-types .",
168-
"blade-formatter": "blade-formatter resources/views/*.blade.php resources/views/**/*.blade.php --ignore-path= --php-version=8.1 --progress",
184+
"blade-formatter": "blade-formatter resources/views/*.blade.php resources/views/**/*.blade.php --ignore-path= --php-version=8.2 --progress",
169185
"blade-formatter:check-formatted": "@blade-formatter --check-formatted",
170186
"blade-formatter:write": "@blade-formatter --write",
171187
"cghooks": "@php vendor/bin/cghooks --ansi -vv",
@@ -250,17 +266,19 @@
250266
"composer:unlink": "@php -r \"@unlink('vendor/bin/composer');\"",
251267
"composer:validate": "@composer validate --check-lock --strict --ansi -vv",
252268
"detect-collisions": "@php vendor/bin/detect-collisions examples/ src/",
269+
"ecs": "@php vendor/bin/ecs --ansi -vv",
270+
"ecs:check": "@ecs check",
271+
"ecs:check-output-format-json": "@ecs:check --output-format=json",
272+
"ecs:fix": "@ecs:check --fix",
273+
"ecs:list-checkers": "@ecs list-checkers",
253274
"facade:lint": "@facade:update --lint",
254275
"facade:update": "@php -f vendor/bin/facade.php -- Guanguans\\\\SoarPHP\\\\Facades\\\\SoarPHP",
255276
"git-chglog": "git-chglog $(git describe --tags $(git rev-list --tags --max-count=1))",
256277
"gitleaks": "gitleaks git --report-path=.build/gitleaks-report.json -v",
257278
"gitleaks:generate-baseline": "gitleaks git --report-path=gitleaks-baseline.json -v",
258-
"grumphp": [
259-
"@putenv:php",
260-
"$PHP82 vendor/bin/grumphp run --ansi -vv"
261-
],
262-
"jack": "@php vendor/bin/jack --ansi -vv",
263-
"jack:breakpoint": "@jack breakpoint --limit=7",
279+
"grumphp": "@php vendor/bin/grumphp run --ansi -vv",
280+
"jack": "@php vendor/bin/jack",
281+
"jack:breakpoint": "@jack breakpoint --limit=8",
264282
"jack:breakpoint-dev": "@jack:breakpoint --dev",
265283
"jack:open-versions": "@jack open-versions --limit=99",
266284
"jack:open-versions-dev": "@jack:open-versions --dev",
@@ -284,10 +302,7 @@
284302
"mago:lint-dry-run": "@mago:lint --dry-run",
285303
"mago:lint-list-rules": "@mago lint --list-rules",
286304
"mago:lint-semantics-only": "@mago lint --semantics-only",
287-
"monorepo-builder": [
288-
"@putenv:php",
289-
"$PHP82 vendor/bin/monorepo-builder --ansi -vv"
290-
],
305+
"monorepo-builder": "@php vendor/bin/monorepo-builder --ansi -vv",
291306
"monorepo-builder:release": [
292307
"@git-chglog",
293308
"@monorepo-builder release"
@@ -301,10 +316,7 @@
301316
"monorepo-builder:release-patch": "@monorepo-builder:release patch",
302317
"monorepo-builder:release-patch-dry-run": "@monorepo-builder:release-patch --dry-run",
303318
"neon-lint": "@php vendor/bin/neon-lint *.neon",
304-
"peck": [
305-
"@putenv:php",
306-
"$PHP82 vendor/bin/peck check --path=src/ --config=../../peck.json --ansi -vv"
307-
],
319+
"peck": "@php vendor/bin/peck check --path=src/ --config=peck.json --ansi -vv",
308320
"peck:ignore-all": "@peck --ignore-all",
309321
"peck:init": "@peck --init",
310322
"pest": [
@@ -345,11 +357,11 @@
345357
"php-cs-fixer:list-sets": "@php-cs-fixer list-sets --ansi -vv",
346358
"php-lint": [
347359
"@putenv:php",
348-
"for DIR in .; do find $DIR -maxdepth 1 -type f -name '*.php' -type f ! -name 'xxx.php' -exec $PHP81 -l {} \\; 2>&1 | (! grep -v '^No syntax errors detected'); done",
349-
"for DIR in src/ tests/; do find $DIR -type f -name '*.php' -type f ! -name 'xxx.php' -exec $PHP81 -l {} \\; 2>&1 | (! grep -v '^No syntax errors detected'); done"
360+
"for DIR in .; do find $DIR -maxdepth 1 -type f -name '*.php' -type f ! -name 'xxx.php' -exec $PHP82 -l {} \\; 2>&1 | (! grep -v '^No syntax errors detected'); done",
361+
"for DIR in src/ tests/; do find $DIR -type f -name '*.php' -type f ! -name 'xxx.php' -exec $PHP82 -l {} \\; 2>&1 | (! grep -v '^No syntax errors detected'); done"
350362
],
351363
"phpbench": "@php vendor/bin/phpbench run --report=aggregate --ansi -vv",
352-
"phpmnd": "@php vendor/bin/phpmnd src/ --exclude-path=Support/helpers.phpp --ignore-numbers=2,-1 --hint --progress --ansi -vv",
364+
"phpmnd": "@php vendor/bin/phpmnd src/ --exclude-path=Support/helpers.phpp --ignore-numbers=-1,2 --hint --progress --ansi -vv",
353365
"phpstan": "@php vendor/bin/phpstan --ansi -vv",
354366
"phpstan:analyse": "@phpstan analyse",
355367
"phpstan:analyse-error-format-annotate-pull-request": "@php vendor/bin/phpstan --ansi -vv 'analyse' --error-format=checkstyle | vendor/bin/cs2pr --notices-as-warnings --colorize",
@@ -404,15 +416,9 @@
404416
"rector:process-only-dry-run": "@rector:process-only --dry-run",
405417
"rector:process-options": "@rector:process-clear-cache --config=rector-options.php",
406418
"rector:process-options-dry-run": "@rector:process-options --dry-run",
407-
"roave-backward-compatibility-check": [
408-
"@putenv:php",
409-
"$PHP82 vendor/bin/roave-backward-compatibility-check --install-development-dependencies --ansi -vv"
410-
],
419+
"roave-backward-compatibility-check": "@php vendor/bin/roave-backward-compatibility-check --install-development-dependencies --ansi -vv",
411420
"roave-backward-compatibility-check:format-github-actions": "@roave-backward-compatibility-check --format=github-actions",
412-
"rule-doc-generator": [
413-
"@putenv:php",
414-
"$PHP82 rule-doc-generator --ansi -vv"
415-
],
421+
"rule-doc-generator": "@php rule-doc-generator --ansi -vv",
416422
"rule-doc-generator:generate": "@rule-doc-generator generate src/Support/Rectors/ --output-file=src/Support/Rectors/rules-overview.md",
417423
"rule-doc-generator:validate": "@rule-doc-generator validate src/Support/Rectors/",
418424
"sk": "@php vendor/bin/swiss-knife --ansi -vv",
@@ -436,14 +442,6 @@
436442
"sk:search-regex": "@sk search-regex 'Guanguans.*ValetDrivers'",
437443
"sk:split-config-per-package": "@sk split-config-per-package monorepo-builder.php",
438444
"sk:spot-lazy-traits": "@sk spot-lazy-traits src/ --max-used=2",
439-
"soar-php": "@php soar-php --ansi -vv",
440-
"soar-php:app-build": [
441-
"@composer install --no-dev --no-scripts --ansi -vv",
442-
"@php soar-php app:build soar-php.phar --build-version=master --ansi",
443-
"@php builds/soar-php.phar list --ansi -vv",
444-
"ls -lh builds/soar-php.phar",
445-
"ls -lr builds/soar-php.phar"
446-
],
447445
"soar-php:check-binary": "Guanguans\\SoarPHP\\Support\\ComposerScripts::checkSoarBinary",
448446
"soar-php:dump-config": [
449447
"@soar-php:dump-yaml-config",
@@ -464,19 +462,6 @@
464462
"@composer-config:disable-process-timeout",
465463
"@php -S localhost:8123 examples/example.php"
466464
],
467-
"testbench": "@php vendor/bin/testbench --ansi",
468-
"testbench:build": "@testbench workbench:build",
469-
"testbench:clear": "@testbench package:purge-skeleton",
470-
"testbench:prepare": "@testbench package:discover",
471-
"testbench:serve": [
472-
"@composer-config:disable-process-timeout",
473-
"@testbench:build",
474-
"@testbench serve"
475-
],
476-
"testbench:test": [
477-
"@testbench:clear",
478-
"@pest"
479-
],
480465
"todo-lint": "! git --no-pager grep --extended-regexp --ignore-case 'todo|fixme' -- '*.php' ':!*.blade.php' ':(exclude)resources/'",
481466
"trufflehog": "trufflehog git https://github.com/guanguans/soar-php --only-verified",
482467
"typos": "typos --color=always --sort --verbose",

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ parameters:
4949
excludePaths:
5050
- tests/Fixtures/
5151
tmpDir: .build/phpstan/
52-
phpVersion: 80100
52+
phpVersion: 80200
5353
level: max
5454
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
5555
errorFormat: friendly

0 commit comments

Comments
 (0)