From d92977ef926dbfe09e088863f4ca2f3ac2d90fe0 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 19 Jan 2026 17:01:24 +0100 Subject: [PATCH] ci(lint): Use multi file argument in lint Since PHP 8.3 the linting command "php -l" can consume multiple files at once. This drastically speeds up the time necessary for the linting from ~3 minutes to few seconds. By also running the linting on multiple cores, the time can be dropped to < 1s Signed-off-by: Joas Schilling --- composer.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ff8308381bd..6433943ad25 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,12 @@ "scripts": { "cs:check": "php-cs-fixer fix --dry-run --diff", "cs:fix": "php-cs-fixer fix", - "lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './lib/Vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l", + "lint": [ + "@lint-8.2-or-earlier", + "@lint-8.3-or-later" + ], + "lint-8.2-or-earlier": "[ $(php -r \"echo PHP_VERSION_ID;\") -ge 80300 ] || find . -type f -name '*.php' -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './lib/Vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -not -path 'tests/stubs/*' -print0 | xargs -0 -n1 -P$(nproc) php -l", + "lint-8.3-or-later": "[ $(php -r \"echo PHP_VERSION_ID;\") -lt 80300 ] || find . -type f -name '*.php' -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './lib/Vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -not -path 'tests/stubs/*' -print0 | xargs -0 -n200 -P$(nproc) php -l", "openapi": "generate-spec && (npm run typescript:generate || echo 'Please manually regenerate the typescript OpenAPI models')", "rector:check": "rector --dry-run", "rector:fix": "rector",