From 202eae5136a4b2ec919734de32ca81f0fd0d5571 Mon Sep 17 00:00:00 2001 From: Michael Weimann Date: Thu, 15 Dec 2022 20:45:14 +0100 Subject: [PATCH] Specify PHP version for PHPCS Signed-off-by: Michael Weimann --- .gitlab-ci.yml | 3 +++ composer.json | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e42c854..4006f048 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -126,6 +126,9 @@ phpcs: image: composer:latest stage: validate script: + # tell phpcs the PHP version to check against + # we are using the min suppported version here + - ./vendor/bin/phpcs --config-set php_version 80100 - ./vendor/bin/phpcs -p --no-colors --basepath="$PWD" phpstan: diff --git a/composer.json b/composer.json index e5ce70ba..7ba7e5e8 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,15 @@ } ], "scripts": { - "phpcs": "phpcs -p --cache", - "phpcbf": "phpcbf -p", + "phpcs:setup": "phpcs --config-set php_version 80100", + "phpcs": [ + "composer phpcs:setup", + "phpcs -p --cache" + ], + "phpcbf": [ + "composer phpcs:setup", + "phpcbf -p" + ], "phpstan": "phpstan" }, "require": {