Skip to content

Commit 5166255

Browse files
committed
feat(requirements): Update minimum PHP version requirement to 8.2
- Increase minimum PHP version from 8.1 to 8.2 in composer.json and vendor-bin/common/composer.json - Update GitHub workflows (phpstan, rector, php-cs-fixer, tests) to use PHP 8.2 as the baseline - Adjust blade-formatter script to use PHP 8.2 - Revise README to reflect new PHP requirement - Remove PHP 8.1 from test matrix to ensure compatibility and consistency - Change is necessary to adopt latest language features, improve security, and maintain support for dependencies
1 parent 82a48f3 commit 5166255

File tree

13 files changed

+61
-111
lines changed

13 files changed

+61
-111
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: [ubuntu-latest]
18-
php: [8.1, 8.2, 8.3, 8.4, 8.5]
18+
php: [8.2, 8.3, 8.4, 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
@@ -62,7 +62,7 @@
6262

6363
## Requirement
6464

65-
* PHP >= 8.1
65+
* PHP >= 8.2
6666

6767
## Installation
6868

composer-bump

Lines changed: 9 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
)
@@ -98,6 +98,7 @@ final class ComposerBump
9898
public function __invoke(): void
9999
{
100100
$this
101+
->updateComposerPackages()
101102
->updateOutdatedComposerPackages()
102103
->updateComposerPackages()
103104
->updateOutdatedComposerPackages()
@@ -217,7 +218,7 @@ final class ComposerBump
217218
),
218219
$lowestArrayVersion[0] < $highestArrayVersion[0] => array_map(
219220
static fn (string $major): string => "^$major.0",
220-
range($lowestArrayVersion[0] + 1, $highestArrayVersion[0])
221+
range((int) $lowestArrayVersion[0] + 1, $highestArrayVersion[0])
221222
),
222223
default => []
223224
},

composer-dependency-analyser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
__DIR__.'/tests/',
2323
])
2424
->ignoreUnknownClasses([
25-
SensitiveParameter::class,
25+
// SensitiveParameter::class,
2626
])
2727
/** @see \ShipMonk\ComposerDependencyAnalyser\Analyser::CORE_EXTENSIONS */
2828
->ignoreErrorsOnExtensions(

composer.json

Lines changed: 36 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -77,49 +77,53 @@
7777
}
7878
],
7979
"require": {
80-
"php": ">=8.1",
80+
"php": ">=8.2",
8181
"ext-simplexml": "*",
8282
"guzzlehttp/guzzle": "^7.10",
8383
"guzzlehttp/uri-template": "^1.0",
8484
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0",
85-
"symfony/options-resolver": "^6.4 || ^7.0 || ^8.0"
85+
"symfony/options-resolver": "^7.4 || ^8.0"
8686
},
8787
"require-dev": {
8888
"adamwojs/php-cs-fixer-phpdoc-force-fqcn": "^2.0",
8989
"bamarni/composer-bin-plugin": "^1.9",
9090
"brainmaestro/composer-git-hooks": "^3.0",
91+
"composer/composer": "^2.9",
9192
"ergebnis/composer-normalize": "^2.50",
9293
"ergebnis/license": "^2.7",
9394
"ergebnis/php-cs-fixer-config": "^6.60",
9495
"ergebnis/phpstan-rules": "^2.13",
95-
"ergebnis/rector-rules": "^1.14",
96+
"ergebnis/rector-rules": "^1.15",
9697
"fakerphp/faker": "^1.24",
98+
"guanguans/monorepo-builder-worker": "^3.1",
9799
"guanguans/php-cs-fixer-custom-fixers": "^1.2",
98100
"guanguans/phpstan-rules": "^1.1",
99101
"guanguans/rector-rules": "^1.7",
100-
"illuminate/support": "^10.49 || ^11.0 || ^12.0 || ^13.0",
102+
"illuminate/support": "^12.56 || ^13.0",
101103
"jbelien/phpstan-sarif-formatter": "^1.2",
102104
"mockery/mockery": "^1.6",
103-
"nette/utils": "^4.0",
105+
"mrpunyapal/peststan": "^0.1",
106+
"mrpunyapal/rector-pest": "^0.2",
107+
"nette/utils": "^4.1",
104108
"nicksdot/phpstan-phpstorm-error-identifiers": "^0.3",
105-
"pestphp/pest": "^2.36 || ^3.0 || ^4.0",
106-
"pestphp/pest-plugin-arch": "^2.7 || ^3.0 || ^4.0",
107-
"pestphp/pest-plugin-profanity": "^1.7 || ^2.0 || ^3.0 || ^4.0",
109+
"pestphp/pest": "^3.8 || ^4.0",
110+
"pestphp/pest-plugin-arch": "^3.1 || ^4.0",
111+
"pestphp/pest-plugin-profanity": "^3.23 || ^4.0",
108112
"php-mock/php-mock-phpunit": "^2.15",
109-
"phpbench/phpbench": "^1.4",
113+
"phpbench/phpbench": "^1.6",
110114
"phpstan/extension-installer": "^1.4",
111-
"phpstan/phpstan": "^2.1",
112115
"phpstan/phpstan-deprecation-rules": "^2.0",
113116
"phpstan/phpstan-mockery": "^2.0",
114117
"phpstan/phpstan-strict-rules": "^2.0",
115118
"phpstan/phpstan-webmozart-assert": "^2.0",
116-
"phpunit/phpunit": "^10.5 || ^11.0 || ^12.0 || ^13.0",
119+
"phpunit/phpunit": "^11.5 || ^12.0 || ^13.0",
117120
"povils/phpmnd": "^3.6",
118121
"rector/argtyper": "^0.6",
119122
"rector/jack": "^0.5",
120-
"rector/rector": "^2.3",
121123
"rector/swiss-knife": "^2.3",
122124
"rector/type-perfect": "^2.1",
125+
"roave/backward-compatibility-check": "^8.14",
126+
"roave/no-floaters": "^1.13",
123127
"shipmonk/composer-dependency-analyser": "^1.8",
124128
"shipmonk/dead-code-detector": "^0.15",
125129
"shipmonk/name-collision-detector": "^2.1",
@@ -132,7 +136,9 @@
132136
"staabm/phpstan-todo-by": "^0.3",
133137
"staabm/side-effects-detector": "^1.0",
134138
"symfony/thanks": "^1.4",
135-
"symfony/var-dumper": "^6.4 || ^7.0 || ^8.0",
139+
"symfony/var-dumper": "^7.4 || ^8.0",
140+
"symplify/coding-standard": "^13.0",
141+
"symplify/easy-coding-standard": "^13.0",
136142
"symplify/phpstan-rules": "^14.9",
137143
"tomasvotruba/class-leak": "^2.1",
138144
"tomasvotruba/cognitive-complexity": "^1.0",
@@ -183,7 +189,7 @@
183189
"target-directory": "vendor-bin"
184190
},
185191
"branch-alias": {
186-
"dev-main": "4.x-dev"
192+
"dev-main": "5.x-dev"
187193
},
188194
"composer-normalize": {
189195
"indent-size": 4,
@@ -211,7 +217,7 @@
211217
"actionlint": "actionlint -ignore=SC2035 -ignore=SC2086 -color -oneline -verbose",
212218
"argtyper": "@php vendor/bin/argtyper --ansi -vv",
213219
"argtyper:add-types": "@argtyper add-types .",
214-
"blade-formatter": "blade-formatter resources/views/*.blade.php resources/views/**/*.blade.php --ignore-path= --php-version=8.1 --progress",
220+
"blade-formatter": "blade-formatter resources/views/*.blade.php resources/views/**/*.blade.php --ignore-path= --php-version=8.2 --progress",
215221
"blade-formatter:check-formatted": "@blade-formatter --check-formatted",
216222
"blade-formatter:write": "@blade-formatter --write",
217223
"cghooks": "@php vendor/bin/cghooks --ansi -vv",
@@ -233,6 +239,7 @@
233239
"@jack:breakpoint",
234240
"@jack:open-versions-dry-run",
235241
"@jack:raise-to-installed-dry-run",
242+
"@jsonlint",
236243
"@notify:generate-ide-json",
237244
"@notify:platform-lint",
238245
"@phpmnd",
@@ -292,15 +299,17 @@
292299
"composer:unlink": "@php -r \"@unlink('vendor/bin/composer');\"",
293300
"composer:validate": "@composer validate --check-lock --strict --ansi -vv",
294301
"detect-collisions": "@php vendor/bin/detect-collisions benchmarks/ src/",
302+
"ecs": "@php vendor/bin/ecs --ansi -vv",
303+
"ecs:check": "@ecs check",
304+
"ecs:check-output-format-json": "@ecs:check --output-format=json",
305+
"ecs:fix": "@ecs:check --fix",
306+
"ecs:list-checkers": "@ecs list-checkers",
295307
"facade:lint": "@facade:update --lint",
296308
"facade:update": "@php -f vendor/bin/facade.php -- Guanguans\\\\Notify\\\\Facades\\\\ApiResponseFacade",
297309
"git-chglog": "git-chglog $(git describe --tags $(git rev-list --tags --max-count=1))",
298310
"gitleaks": "gitleaks git --report-path=.build/gitleaks-report.json -v",
299311
"gitleaks:generate-baseline": "gitleaks git --report-path=gitleaks-baseline.json -v",
300-
"grumphp": [
301-
"@putenv:php",
302-
"$PHP82 vendor/bin/grumphp run --ansi -vv"
303-
],
312+
"grumphp": "@php vendor/bin/grumphp run --ansi -vv",
304313
"jack": "@php vendor/bin/jack",
305314
"jack:breakpoint": "@jack breakpoint --limit=8",
306315
"jack:breakpoint-dev": "@jack:breakpoint --dev",
@@ -326,10 +335,7 @@
326335
"mago:lint-dry-run": "@mago:lint --dry-run",
327336
"mago:lint-list-rules": "@mago lint --list-rules",
328337
"mago:lint-semantics-only": "@mago lint --semantics-only",
329-
"monorepo-builder": [
330-
"@putenv:php",
331-
"$PHP82 vendor/bin/monorepo-builder --ansi -vv"
332-
],
338+
"monorepo-builder": "@php vendor/bin/monorepo-builder --ansi -vv",
333339
"monorepo-builder:release": [
334340
"@git-chglog",
335341
"@monorepo-builder release"
@@ -343,35 +349,24 @@
343349
"monorepo-builder:release-patch": "@monorepo-builder:release patch",
344350
"monorepo-builder:release-patch-dry-run": "@monorepo-builder:release-patch --dry-run",
345351
"neon-lint": "@php vendor/bin/neon-lint *.neon",
346-
"notify": "@php notify --ansi -vv",
347-
"notify:app-build": [
348-
"@composer install --no-dev --no-scripts --ansi -vv",
349-
"@php notify app:build notify.phar --build-version=master --ansi",
350-
"@php builds/notify.phar list --ansi -vv",
351-
"ls -lh builds/notify.phar",
352-
"ls -lr builds/notify.phar"
353-
],
354352
"notify:generate-gitleaks-ignore": "Guanguans\\Notify\\Foundation\\Support\\ComposerScripts::generateGitleaksIgnore",
355353
"notify:generate-ide-json": "Guanguans\\Notify\\Foundation\\Support\\ComposerScripts::generateIdeJson",
356354
"notify:phpdoc-parse": "Guanguans\\RectorRules\\Support\\ComposerScripts::phpdocParse",
357355
"notify:platform-lint": "Guanguans\\Notify\\Foundation\\Support\\ComposerScripts::platformLint",
358-
"peck": [
359-
"@putenv:php",
360-
"$PHP82 vendor/bin/peck check --path=src/ --config=../../peck.json --ansi -vv"
361-
],
356+
"peck": "@php vendor/bin/peck check --path=src/ --config=peck.json --ansi -vv",
362357
"peck:ignore-all": "@peck --ignore-all",
363358
"peck:init": "@peck --init",
364359
"pest": [
365360
"@putenv:xdebug-on",
366-
"@php vendor/bin/pest --colors=always --min=90 --coverage --profile",
361+
"@php vendor/bin/pest --colors=always --min=80 --coverage --profile",
367362
"@putenv:xdebug-off"
368363
],
369364
"pest:coverage": "@pest --coverage-html=.build/phpunit/ --coverage-clover=.build/phpunit/clover.xml",
370365
"pest:generate-baseline": "@pest --generate-baseline=phpunit-baseline.xml",
371366
"pest:highest": [
372367
"@putenv:php",
373368
"@putenv:xdebug-on",
374-
"$PHP85 vendor/bin/pest --colors=always --min=90 --coverage --profile",
369+
"$PHP85 vendor/bin/pest --colors=always --min=80 --coverage --profile",
375370
"@putenv:xdebug-off"
376371
],
377372
"pest:migrate-configuration": "@pest --migrate-configuration",
@@ -399,8 +394,8 @@
399394
"php-cs-fixer:list-sets": "@php-cs-fixer list-sets --ansi -vv",
400395
"php-lint": [
401396
"@putenv:php",
402-
"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",
403-
"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"
397+
"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",
398+
"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"
404399
],
405400
"phpbench": "@php vendor/bin/phpbench run --report=aggregate --ansi -vv",
406401
"phpmnd": "@php vendor/bin/phpmnd src/ --exclude-path=Support/helpers.phpp --ignore-numbers=-1,2,200,201,202,300,301,302,304,400,401,402,403,404,408,409,422,429,500,9999999999 --hint --progress --ansi -vv",
@@ -456,15 +451,9 @@
456451
"rector:process-dry-run-output-format-github": "@rector:process-dry-run --output-format=github",
457452
"rector:process-only": "@rector:process-clear-cache src/ --only=Guanguans\\Notify\\Foundation\\Rectors\\MessageRector",
458453
"rector:process-only-dry-run": "@rector:process-only --dry-run",
459-
"roave-backward-compatibility-check": [
460-
"@putenv:php",
461-
"$PHP82 vendor/bin/roave-backward-compatibility-check --install-development-dependencies --ansi -vv"
462-
],
454+
"roave-backward-compatibility-check": "@php vendor/bin/roave-backward-compatibility-check --install-development-dependencies --ansi -vv",
463455
"roave-backward-compatibility-check:format-github-actions": "@roave-backward-compatibility-check --format=github-actions",
464-
"rule-doc-generator": [
465-
"@putenv:php",
466-
"$PHP82 rule-doc-generator --ansi -vv"
467-
],
456+
"rule-doc-generator": "@php rule-doc-generator --ansi -vv",
468457
"rule-doc-generator:generate": "@rule-doc-generator generate src/Support/Rectors/ --output-file=src/Support/Rectors/rules-overview.md",
469458
"rule-doc-generator:validate": "@rule-doc-generator validate src/Support/Rectors/",
470459
"sk": "@php vendor/bin/swiss-knife --ansi -vv",
@@ -488,24 +477,7 @@
488477
"sk:search-regex": "@sk search-regex 'Guanguans.*ValetDrivers'",
489478
"sk:split-config-per-package": "@sk split-config-per-package monorepo-builder.php",
490479
"sk:spot-lazy-traits": "@sk spot-lazy-traits src/ --max-used=2",
491-
"testbench": "@php vendor/bin/testbench --ansi -vv",
492-
"testbench:build": "@testbench workbench:build",
493-
"testbench:clear": "@testbench package:purge-skeleton",
494-
"testbench:optimize:image": "@testbench optimize:image",
495-
"testbench:optimize:image-dry-run": "@testbench:optimize:image --dry-run",
496-
"testbench:prepare": "@testbench package:discover",
497-
"testbench:serve": [
498-
"@composer-config:disable-process-timeout",
499-
"@testbench:build",
500-
"@testbench serve"
501-
],
502-
"testbench:test": [
503-
"@testbench:clear",
504-
"@pest"
505-
],
506-
"testbench:workbench:install": "@testbench workbench:install",
507480
"todo-lint": "! git --no-pager grep --extended-regexp --ignore-case 'todo|fixme' -- '*.php' ':!*.blade.php' ':(exclude)src/Foundation/Concerns/HasOptions.php'",
508-
"touch:database-sqlite": "@php -r \"file_exists('vendor/orchestra/testbench-core/laravel/database/database.sqlite') || touch('vendor/orchestra/testbench-core/laravel/database/database.sqlite');\"",
509481
"trufflehog": "trufflehog git https://github.com/guanguans/notify --only-verified",
510482
"typos": "typos --color=always --sort --verbose",
511483
"typos:write-changes": "@typos --write-changes",

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ parameters:
5454
- tests/Fixtures/
5555
- *.blade.php
5656
tmpDir: .build/phpstan/
57-
phpVersion: 80100
57+
phpVersion: 80200
5858
level: max
5959
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
6060
errorFormat: friendly

0 commit comments

Comments
 (0)